note 39118 deleted from function.date by tomsommer

From: Date: Sat, 17 Jan 2004 18:32:43 +0000
Subject: note 39118 deleted from function.date by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-63744@lists.php.net to get a copy of this message
Note Submitter: mjs2000 ---- Here's a front-end for the date() function that accepts a MySQL timestamp (in the format YYYYMMDDHHMMSS): <?php function mysql_date($format, $timestamp) { preg_match("/(....)(..)(..)(..)(..)(..)/", $timestamp, $match); return date($format, mktime($match[4], $match[5], $match[6], $match[2], $match[3], $match[1])); } ?>

« previous php.notes (#63744) next »