note 24009 added to function.date
| From: | savage1 at insomniax dot net | Date: | Sat, 03 Aug 2002 23:25:42 +0000 |
| Subject: | note 24009 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34242@lists.php.net to get a copy of this message | ||
Converting mySQL timestamp to PHP timestamp to use in a date(); function call. Something small and
simple.
function make_time($datetime) {
// Converts mySQL timestamp to PHP timestamp
// for use with date();
$yr = substr($datetime,0,4);
$mon = substr($datetime,4,2);
$day = substr($datetime,6,2);
$hr = substr($datetime,8,2);
$min = substr($datetime,10,2);
$sec = substr($datetime,12,2);
return mktime($hr,$min,$sec,$mon,$day,$yr);
}
--
http://www.php.net/manual/en/function.date.php
http://master.php.net/manage/user-notes.php?action=edit+24009
http://master.php.net/manage/user-notes.php?action=delete+24009
http://master.php.net/manage/user-notes.php?action=reject+24009