#40717 [Asn]: date "01-01-1968" inaccessible via date function

From: Date: Mon, 05 Mar 2007 10:20:38 +0000
Subject: #40717 [Asn]: date "01-01-1968" inaccessible via date function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-109904@lists.php.net to get a copy of this message
ID: 40717 User updated by: manuel dot pinhao at nvisible dot pt Reported By: manuel dot pinhao at nvisible dot pt Status: Assigned Bug Type: Date/time related Operating System: Windows XP SP2 PHP Version: 5.2.1 Assigned To: derick New Comment: Yes, this seems to be a windows-only problem. I've tested it on Linux and it works as expected. Regarding DST, I'm no expert on this matter, but DST could probably 'bump' time one hour forwards or backwards, not lose a whole day. As for testing 6-7 AM, I wasn't able to target any hours in 01-01-1968. Previous Comments: ------------------------------------------------------------------------ [2007-03-05 10:03:49] derick@php.net This works fine for me (on Linux): -63158410: 31-12-1967 23:59:50 (UTC) -63158409: 31-12-1967 23:59:51 (UTC) -63158408: 31-12-1967 23:59:52 (UTC) -63158407: 31-12-1967 23:59:53 (UTC) -63158406: 31-12-1967 23:59:54 (UTC) -63158405: 31-12-1967 23:59:55 (UTC) -63158404: 31-12-1967 23:59:56 (UTC) -63158403: 31-12-1967 23:59:57 (UTC) -63158402: 31-12-1967 23:59:58 (UTC) -63158401: 31-12-1967 23:59:59 (UTC) -63158400: 01-01-1968 00:00:00 (UTC) -63158399: 01-01-1968 00:00:01 (UTC) -63158398: 01-01-1968 00:00:02 (UTC) -63158397: 01-01-1968 00:00:03 (UTC) -63158396: 01-01-1968 00:00:04 (UTC) -63158395: 01-01-1968 00:00:05 (UTC) -63158394: 01-01-1968 00:00:06 (UTC) -63158393: 01-01-1968 00:00:07 (UTC) -63158392: 01-01-1968 00:00:08 (UTC) -63158391: 01-01-1968 00:00:09 (UTC) -63158390: 01-01-1968 00:00:10 (UTC) ------------------------------------------------------------------------ [2007-03-05 00:11:56] iliaa@php.net The DST offset could move you to the next day, you may want to try to pick 6-7 am on the 1st of Jan 1968 to see if that works. ------------------------------------------------------------------------ [2007-03-04 18:36:37] manuel dot pinhao at nvisible dot pt same output with the following code: date_default_timezone_set("UTC"); foreach (range(-63158410,-63158390) as $s) { echo $s.': '.date("d-m-Y H:i:s (T)",$s)."<br>"; } Shouldn't this work regardless of the timezone? How can we have a 'disappearing' day? ------------------------------------------------------------------------ [2007-03-04 18:17:45] iliaa@php.net Have you tried setting the timezone via the php prescribed function: date_default_timezone_set() ? ------------------------------------------------------------------------ [2007-03-04 17:43:11] manuel dot pinhao at nvisible dot pt I get the same output with this code: putenv("TZ=UTC"); foreach (range(-63158410,-63158390) as $s) { echo $s.': '.date("d-m-Y H:i:s (T)",$s)."<br>"; } ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/40717 -- Edit this bug report at http://bugs.php.net/?id=40717&edit=1

« previous php.bugs (#109904) next »