note 9432 deleted from function.strtotime by jimw
| From: | jimw@php.net | Date: | Fri, 14 Dec 2001 20:56:19 +0000 |
| Subject: | note 9432 deleted from function.strtotime by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22791@lists.php.net to get a copy of this message | ||
[Editor's note: MySQL does have a function to handle the conversion UNIX_TIMESTAMP (read the
MySQL manual for more details). So, in reality there is no need to do a post-query manipulation in
this case, just ask for "SELECT ..., UNIX_TIMESTAMP(datetime_field) ..."]
Here is a 1 line trick to convert a MySQL time into a timestamp :
$time = mktime( substr( $sqltime, 0, 2), substr( $sqltime, 3, 2));
Simple, but i didn't find it in the suggestions !