note 9609 added to time
| From: | andre dot feld at gmx dot de | Date: | Tue, 14 Nov 2000 21:55:00 +0000 |
| Subject: | note 9609 added to time | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7697@lists.php.net to get a copy of this message | ||
To convert a mysql timestamp (14 Byte) into a unix timestamp:
// This function translates es mysql timestamp to // a unix timestamp
function epoch($timestamp)
{
$hour = substr($timestamp,8,2);
$minute = substr($timestamp,10,2);
$second = substr($timestamp,12,2);
$month = substr($timestamp,4,2);
$day = substr($timestamp,6,2);
$year = substr($timestamp,0,4);
return mktime($hour, $minute, $second, $month, $day, $year);
}
http://www.php.net/manual/function.time.php