note 21491 added to function.mktime
| From: | kris@php.net | Date: | Wed, 15 May 2002 04:24:28 +0000 |
| Subject: | note 21491 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30655@lists.php.net to get a copy of this message | ||
function to convert a mySQL DateTime field to a Unix Timestamp (add error checking as necessary):
function unixTimeStampFromSQLDateTime($strSQLDateTime){
$arrDateTime = explode(" ", $strSQLDateTime);
$arrDate = explode("-", $arrDateTime[0]);
$arrTime = explode(":", $arrDateTime[1]);
return mktime($arrTime[0], $arrTime[1], $arrTime[2], $arrDate[1], $arrDate[2],
$arrDate[0]);
}
--
http://www.php.net/manual/en/function.mktime.php
http://master.php.net/manage/user-notes.php?action=edit+21491
http://master.php.net/manage/user-notes.php?action=delete+21491
http://master.php.net/manage/user-notes.php?action=reject+21491