#44909 [Opn->WFx]: strtotime doesn't recognize UT timezone
| From: | derick@php.net | Date: | Sun, 04 May 2008 08:54:47 +0000 |
| Subject: | #44909 [Opn->WFx]: strtotime doesn't recognize UT timezone | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-124708@lists.php.net to get a copy of this message | ||
ID: 44909
Updated by: derick@php.net
Reported By: selsky at columbia dot edu
-Status: Open
+Status: Wont fix
Bug Type: Date/time related
Operating System: Solaris
PHP Version: 5.2.6
New Comment:
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 (http://no2.php.net/timezones) 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.
Previous Comments:
------------------------------------------------------------------------
[2008-05-04 08:30:13] selsky at columbia dot edu
Description:
------------
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.
http://bugs.php.net/bug.php?id=42486 was closed
as won't fix, but this
means we can't parse valid rfc2822 strings.
Reproduce code:
---------------
<?php
print strtotime('12 Sep 2007 15:49:12 UTC') . "\n";
print strtotime('12 Sep 2007 15:49:12 UT') . "\n";
Expected result:
----------------
1189612152
1189612152
Actual result:
--------------
1189612152
[blank]
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44909&edit=1