note 85338 deleted from function.date by mgf
| From: | mgf@php.net | Date: | Wed, 27 Aug 2008 12:46:20 +0000 |
| Subject: | note 85338 deleted from function.date by mgf | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-143874@lists.php.net to get a copy of this message | ||
Note Submitter: matt at ihaventthefoggiest dot com
Reason: useless
----
Useful function for formatting a date from a database. Takes two parameters: a date string in the
format yyyy-mm-dd and a date() format string.
<?php
function formatSQLDate($date, $format) {
list($year, $month, $day) = explode('-', $date);
return date($format, mktime(0,0,0, $month, $day, $year));
}
?>