From:             cmt042 at motorola dot com
Operating system: UNIX
PHP version:      5.2.6
PHP Bug Type:     Date/time related
Bug description:  strtotime give wrong result when DST changes

Description:
------------
When DST changes, the strtotime function give back wrong result.

Reproduce code:
---------------
// Need to adjust the day or hour numbers when run the code to make it
cross the DST, Mar 8th 2:00AM 2009

$output = array();
  
for ($i = 15; $i <=19; $i++)
{
  $t = strtotime("+157 days +${i} hours");
  $output[] = date("r",$t);
}

foreach ($output as $line)
    print $line . "\n";


Expected result:
----------------
  
Sun, 08 Mar 2009 00:54:09 -0600
Sun, 08 Mar 2009 01:54:09 -0600
Sun, 08 Mar 2009 03:54:09 -0500
Sun, 08 Mar 2009 04:54:09 -0500
Sun, 08 Mar 2009 05:54:09 -0500

Actual result:
--------------
  
Sun, 08 Mar 2009 00:54:09 -0600
Sun, 08 Mar 2009 01:54:09 -0600
Sun, 08 Mar 2009 03:54:09 -0500
Sun, 08 Mar 2009 03:54:09 -0500
Sun, 08 Mar 2009 04:54:09 -0500

-- 
Edit bug report at http://bugs.php.net/?id=46211&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=46211&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=46211&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=46211&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=46211&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=46211&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=46211&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=46211&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=46211&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=46211&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=46211&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=46211&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=46211&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=46211&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=46211&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=46211&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=46211&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=46211&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=46211&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=46211&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=46211&r=mysqlcfg

Reply via email to