note 118433 added to datetime.formats.date
| From: | matt at azoundria dot com | Date: | Fri, 04 Dec 2015 19:07:28 +0000 |
| Subject: | note 118433 added to datetime.formats.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204283@lists.php.net to get a copy of this message | ||
It's important to note that strtotime does NOT successfully handle any date/time format with
the word 'at' in it. (Commonly used.) ie:
September 15th at 6:12 PM
It also does not handle any date/time format with brackets (also reasonably common).
September 15th (6:12:14 PM)
To get around this, and create a more universally compatible strtotime, create your own custom
strtotime which first filters these out with a str_replace.
function fullstrtotime ($time) {
return strtotime(str_replace(array(" at", "(", ")"), "",
$time));
}
----
Server IP: 72.52.91.14
Probable Submitter: 198.53.55.2
----
Manual Page -- http://php.net/manual/en/datetime.formats.date.php
Edit -- https://master.php.net/note/edit/118433
Del: integrated -- https://master.php.net/note/delete/118433/integrated
Del: useless -- https://master.php.net/note/delete/118433/useless
Del: bad code -- https://master.php.net/note/delete/118433/bad+code
Del: spam -- https://master.php.net/note/delete/118433/spam
Del: non-english -- https://master.php.net/note/delete/118433/non-english
Del: in docs -- https://master.php.net/note/delete/118433/in+docs
Del: other reasons-- https://master.php.net/note/delete/118433
Reject -- https://master.php.net/note/reject/118433
Search -- https://master.php.net/manage/user-notes.php