note 13790 deleted from function.strtotime by jimw
| From: | jimw@php.net | Date: | Fri, 14 Dec 2001 20:57:25 +0000 |
| Subject: | note 13790 deleted from function.strtotime by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22799@lists.php.net to get a copy of this message | ||
If you want to convert a date returned from MySQL, you can use the explode function to reformat in
the form of MM/DD/YYYY which can be used in strtotime().
ex:
$date = "2001-03-25"; /* Date returned from MySQL (YYYY-MM-DD) */
$arDate = explode("-", $date);
$timeStamp = strtotime($arDate[1]."/".$arDate[2]."/".$arDate[0]);
echo date("F j, Y", $timeStamp); /* prints: March 25, 2001 */
(remove the underscore '_' in my email address to reply)