|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-05-14 17:04 UTC] ng4rrjanbiah at rediffmail dot com
Description:
------------
date('I') always return 0 in Windows; but returns according to DST in Linux
Note: found http://bugs.php.net/13900 which is filed for PHP4 and flagged as
"bogus"
Test script:
---------------
<?php
date_default_timezone_set('Pacific/Apia');
$time = strtotime('2006-02-01 23:00:00');
for ($t = $time; $t < ($time + 1000000000); $t+= 100000) {
echo date("Y-m-d H:i:s I T Z", $t) , "\n";
}
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 22:00:01 2025 UTC |
Script: ======= <?php date_default_timezone_set('Pacific/Apia'); $time = strtotime('2008-10-01 23:00:00'); for ($t = $time, $up = ($time + 40000000); $t < $up; $t+= 2000000) { echo date("Y-m-d H:i:s I T Z", $t) , "\n"; } ?> Actual Output on Windows (erroneous): (check the diff in line# 17) ==================================== 2008-10-01 23:00:00 0 WST -39600 2008-10-25 02:33:20 0 WST -39600 2008-11-17 06:06:40 0 WST -39600 2008-12-10 09:40:00 0 WST -39600 2009-01-02 13:13:20 0 WST -39600 2009-01-25 16:46:40 0 WST -39600 2009-02-17 20:20:00 0 WST -39600 2009-03-12 23:53:20 0 WST -39600 2009-04-05 03:26:40 0 WST -39600 2009-04-28 07:00:00 0 WST -39600 2009-05-21 10:33:20 0 WST -39600 2009-06-13 14:06:40 0 WST -39600 2009-07-06 17:40:00 0 WST -39600 2009-07-29 21:13:20 0 WST -39600 2009-08-22 00:46:40 0 WST -39600 2009-09-14 04:20:00 0 WST -39600 2009-10-07 07:53:20 0 WST -39600 2009-10-30 11:26:40 0 WST -39600 2009-11-22 15:00:00 0 WST -39600 2009-12-15 18:33:20 0 WST -39600 Expected Output (working on Linux): ================================== 2008-10-01 23:00:00 0 WST -39600 2008-10-25 02:33:20 0 WST -39600 2008-11-17 06:06:40 0 WST -39600 2008-12-10 09:40:00 0 WST -39600 2009-01-02 13:13:20 0 WST -39600 2009-01-25 16:46:40 0 WST -39600 2009-02-17 20:20:00 0 WST -39600 2009-03-12 23:53:20 0 WST -39600 2009-04-05 03:26:40 0 WST -39600 2009-04-28 07:00:00 0 WST -39600 2009-05-21 10:33:20 0 WST -39600 2009-06-13 14:06:40 0 WST -39600 2009-07-06 17:40:00 0 WST -39600 2009-07-29 21:13:20 0 WST -39600 2009-08-22 00:46:40 0 WST -39600 2009-09-14 04:20:00 0 WST -39600 2009-10-07 08:53:20 1 WSDT -36000 2009-10-30 12:26:40 1 WSDT -36000 2009-11-22 16:00:00 1 WSDT -36000 2009-12-15 19:33:20 1 WSDT -36000