note 57687 deleted from function.strtotime by derick
| From: | derick@php.net | Date: | Sun, 15 Jul 2007 12:45:42 +0000 |
| Subject: | note 57687 deleted from function.strtotime by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-128572@lists.php.net to get a copy of this message | ||
Note Submitter: Jake
----
In case anyone is curious, it seems the date output:
date("l dS of F Y h:i:s A")
Is not parsable by strtotime. I wrote this to accomodate.
<?php
function strtotime_oddformat($datestring)
{
$datepieces = explode(" ", $datestring);
$newdatestring=$datepieces[1]{0}.$datepieces[1]{1}." ".$datepieces[3]."
".$datepieces[4]." ".$datepieces[5]." ".strtolower($datepieces[6]);
return(strtotime($newdatestring));
}
?>