note 8525 added to date
| From: | jonb at imsa dot edu | Date: | Fri, 15 Sep 2000 02:51:34 +0000 |
| Subject: | note 8525 added to date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-5023@lists.php.net to get a copy of this message | ||
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