note 57687 added to function.strtotime
| From: | Jake at osu1 dot php dot net | Date: | Tue, 11 Oct 2005 13:31:21 +0000 |
| Subject: | note 57687 added to function.strtotime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-96828@lists.php.net to get a copy of this message | ||
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));
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.strtotime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57687
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57687&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57687&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57687&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57687&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57687&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57687&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57687&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57687&report=yes
Search -- http://master.php.net/manage/user-notes.php