|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44909 strtotime doesn't recognize UT timezone
Submitted: 2008-05-04 08:30 UTC Modified: 2008-05-04 08:54 UTC
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: selsky at columbia dot edu Assigned:
Status: Wont fix Package: Date/time related
PHP Version: 5.2.6 OS: Solaris
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: selsky at columbia dot edu
New email:
PHP Version: OS:


 [2008-05-04 08:30 UTC] selsky at columbia dot edu
strtotime() does not recognize the timezone "UT".  According to RFC 2822 and the comments in ext/date/php_date.c (line 384), the valid time zones are:

 *  zone        =  "UT"  / "GMT"  /  "EST" / "EDT"  /  "CST" / "CDT"  /  "MST" / "MDT"  /  "PST" / "PDT"  /  1ALPHA  / ( ("+" / "-") 4DIGIT )             

UTC is correctly recognized. was closed as won't fix, but this means we can't parse valid rfc2822 strings.

Reproduce code:
print strtotime('12 Sep 2007 15:49:12 UTC') . "\n";
print strtotime('12 Sep 2007 15:49:12 UT') . "\n";

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-04 08:54 UTC]
The comments to go with the line 384 you're mentioned are actually incorrect. RFC2822 in section 3.1, paragraph 3 it is stated that "These "obs-" elements refer to tokens defined in the obsolete syntax in section 4.  In all cases, these productions are to be ignored for the purposes of generating legal Internet messages and MUST NOT be used as part of such a message." As the comment deals with *generating* a date time string as part of a format, it is invalid to mention those obsolete timezones specifications. The nonterminals in the 2822 rfc starting with "obs-" are obsolete parts of the old (RFC 822) standard. We state in the manual ( which time zones we support, and "UT" is not one of those. First of all those timezone names from from a standardized timezone database, and secondly, UT would be semantically wrong as is explained in bug #42486.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Nov 30 08:05:53 2022 UTC