#41841 [Opn->Bgs]: strtotime() with year + comma before month+day yields time 72420 secs dif
ID: 41841
Updated by: derick@php.net
Reported By: wc_robot at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: Linux/Unix
PHP Version: 5.2.3
New Comment:
This is not a bug. Stand alone "2007" could either mean "the year 2007"
or 20h07m. In case it is standalone the parser assumes the latter. As
MMM dd, YYYY is a common format, there is an exception made. Changing
this could possible break applications, so we can not do that.
Previous Comments:
------------------------------------------------------------------------
[2007-06-28 15:29:02] wc_robot at yahoo dot com
Description:
------------
The year and comma placed before the month and day return a timestamp
that is 72,420 seconds (~20+ hours) later than the value returned when
the year comes after the month and date.
Reproduce code:
---------------
Example #1:
<?php echo strtotime('2007, Feb 1').' '.strtotime('Feb 1, 2007');
?>
Return: 1170382020 1170309600
(and 1170382020 - 1170309600 = 72420)
Example #2:
<?php echo strtotime('2007, Jun 28').' '.strtotime('Jun 28, 2007');
?>
Return: 1183079220 1183006800
(and 1183079220 - 1183006800 = 72420)
Expected result:
----------------
I expect the two values in each different example to yield the same
timestamp.
Actual result:
--------------
The values are always 72,420 seconds different
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41841&edit=1
Thread (2 messages)