RE: [PHP-DB] Converting Dates...
| From: | John W. Holmes | Date: | Thu, 06 Mar 2003 04:10:49 +0000 |
| Subject: | RE: [PHP-DB] Converting Dates... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-26113@lists.php.net to get a copy of this message | ||
> I need help. I need to convert a Date column in MySQL where the date
is
> stored like "2003-01-15" to the following seconds "1042621252 ".
SELECT TO_UNIXTIME(date_column) AS formatted_column FROM yourtable WHERE
...
The TO_UNIXTIME() function will convert the date to the format you need
that is accessible in the "formatted_column" column of the result set.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/