note 34586 deleted from function.mktime by didou
| From: | didou@php.net | Date: | Thu, 31 Jul 2003 13:51:56 +0000 |
| Subject: | note 34586 deleted from function.mktime by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53076@lists.php.net to get a copy of this message | ||
Note Submitter: chad at brainsprain dot net
----
I couldn't find a built in function for converting mySQL dates to Unix Timestamps, and rather
than look any harder, I coded this function and thought it might be useful to others too lazy to
hunt down any others out there. Enjoy:
function mysql_to_unix_ts($mysqlvalue) {
Return mktime(substr($mysqlvalue, 8, 2), substr($mysqlvalue, 10, 2), substr($mysqlvalue, 12, 2),
substr($mysqlvalue, 4, 2), substr($mysqlvalue, 6, 2), substr($mysqlvalue, 0, 4));
}