note 118433 deleted from datetime.formats.date by salathe
| From: | salathe@php.net | Date: | Fri, 12 Apr 2019 15:31:27 +0000 |
| Subject: | note 118433 deleted from datetime.formats.date by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210595@lists.php.net to get a copy of this message | ||
Note Submitter: matt at azoundria dot com
----
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));
}