note 34586 added to function.mktime
| From: | chad at rack1 dot php dot net | Date: | Thu, 31 Jul 2003 13:29:03 +0000 |
| Subject: | note 34586 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-53074@lists.php.net to get a copy of this message | ||
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));
}
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34586
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34586&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34586&report=yes