From:             
Operating system: Linux
PHP version:      5.3.2
Package:          Date/time related
Bug Type:         Bug
Bug description:strtotime() worng result when timezome only.

Description:
------------
Time Formats: tz format (JST, UTC, GMT, EST...) has problem. maybe wrong
(+/-)



Test script:
---------------
[Date]

; Defines the default timezone used by the date functions

date.timezone = "Asia/Tokyo"





<?php

$now = time();



$local  = date("Y-m-d H:i:s",$now);

$gmdate = gmdate("Y-m-d H:i:s",$now);



$tz  = date_default_timezone_get();

$jst = date("Y-m-d H:i:s", strtotime("JST",$now));

$gmt = date("Y-m-d H:i:s", strtotime("GMT",$now));

$utc = date("Y-m-d H:i:s", strtotime("UTC",$now));

$est = date("Y-m-d H:i:s", strtotime("EST",$now));

$edt = date("Y-m-d H:i:s", strtotime("EDT",$now));



echo "

[TIMEZONE:{$tz}]

  DATE: {$local}

GMDATE: {$gmdate}

----

GMT: {$gmt}

UTC: {$utc}

JST: {$jst} (UTC +9)

EDT: {$edt} (UTC -4)

EST: {$est} (UTC -5)

";



Expected result:
----------------
[TIMEZONE:Asia/Tokyo]

  DATE: 2010-07-06 11:58:03

GMDATE: 2010-07-06 02:58:03

----

GMT: 2010-07-06 20:58:03

UTC: 2010-07-06 20:58:03

JST: 2010-07-06 11:58:03 (UTC +9)

EDT: 2010-07-07 00:58:03 (UTC -4)

EST: 2010-07-07 01:58:03 (UTC -5)



Actual result:
--------------
[TIMEZONE:Asia/Tokyo]

  DATE: 2010-07-06 11:58:03

GMDATE: 2010-07-06 02:58:03

----

GMT: 2010-07-06 02:58:03

UTC: 2010-07-06 02:58:03

JST: 2010-07-06 11:58:03 (UTC +9)

EDT: 2010-07-05 22:58:03 (UTC -4)

EST: 2010-07-05 21:58:03 (UTC -5)



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

Reply via email to