note 8525 modified in date by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Fri, 15 Sep 2000 09:14:54 +0000 |
| Subject: | note 8525 modified in date by jmcastagnetto | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-5083@lists.php.net to get a copy of this message | ||
[Editor's note: this function is irrelevant for MySQL, as it has the UNIX_TIMESTAMP() function
(read the MySQL manual for more information), but it could be useful for other databases]
Another note for users trying to use a TIMESTAMP field in mySQL and the date function. I wrote a
small function to convert from mySQL's TIMESTAMP to a UNIX timestamp (compatible with the
date() function).
function sql_to_unix_time($timeString) {
return mktime(substr($timeString, 8,2), substr($timeString, 10,2), substr($timeString, 12,2),
substr($timeString, 4,2), substr($timeString, 6,2), substr($timeString, 0,4));
}
http://www.php.net/manual/function.date.php