note 39118 added to function.date

From: Date: Sat, 17 Jan 2004 17:39:14 +0000
Subject: note 39118 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-63742@lists.php.net to get a copy of this message
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])); } ?> ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39118 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39118&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39118&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#63742) next »