|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
The bug was updated successfully.
Request #63776 strtotime fails with 'at'
Submitted: 2012-12-14 22:53 UTC Modified: 2013-11-27 17:17 UTC
From: matthewcomp at hotmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.4.9 OS: Linux 3.
Private report: No CVE-ID: None
 [2012-12-14 22:53 UTC] matthewcomp at hotmail dot com
From manual page:

Does not work to read a date in the following format:
Nov 19, 2012 at 7:03 PM

Test script:

  $date = "Nov 19, 2012 at 7:03 PM";

  if (($timestamp = strtotime($date)) === false) {
    echo "The string ($date) is bogus";
  } else {
    echo "$date => " . date('l dS \o\f F Y h:i:s A', $timestamp);


Expected result:
Correctly parse the date, ignoring at, which can commonly appear in dates.

Actual result:
Completely unable to parse the date.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-15 04:22 UTC]
-Summary: Fails With 'at' +Summary: strtotime fails With 'at'
 [2012-12-15 04:22 UTC]
-Summary: strtotime fails With 'at' +Summary: strtotime fails with 'at'
 [2013-11-27 17:17 UTC]
-Status: Open +Status: Not a bug
 [2013-11-27 17:17 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

This is not a bug. strtotime() can not parse *everything* you throw at it. In this case it sees the extra text "at" as a timezone abbreviation. But as it does not know the abbreviation, it gives up. You can see what it does by using date_parse():

derick@whisky:/tmp $ php -r 'var_dump( date_parse( "Nov 19, 2012 at 7:03 PM" ) );'

array(13) {
  'year' =>
  'month' =>
  'day' =>
  'hour' =>
  'minute' =>
  'second' =>
  'fraction' =>
  'warning_count' =>
  'warnings' =>
  array(0) {
  'error_count' =>
  'errors' =>
  array(1) {
    [13] =>
    string(47) "The timezone could not be found in the database"
  'is_localtime' =>
  'zone_type' =>
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 08 22:03:36 2021 UTC