From: espertalhao04 at hotmail dot com
Operating system: any linux distro
PHP version: Irrelevant
Package: *General Issues
Bug Type: Bug
Bug description:Weird bug with time handling
Description:
------------
There is a weird bug in time handling (strtotime and date) functions.
You must specify your timezone to perform operations with specified
timezone!
There was no section to write this, so i put it here:
If there is a timezone specified, it should use it to treat this specific
date.
Possible solution:
Verify if the timezone is valid, perform offset calculations and return the
date.
This way, we would be sure that the date is in the same timezone as
specified.
Test script:
---------------
<?=date('d-m-Y h:i:s',strtotime(date('d-m-Y h:i:s',strtotime('02:07:03 Feb
04, 2013 PST'))." GMT"))."<br>"?>
<?date_default_timezone_set('GMT')?>
<?=date('d-m-Y h:i:s',strtotime(date('d-m-Y h:i:s',strtotime('02:07:03 Feb
04, 2013 PST'))." GMT"));?>
<?=date_default_timezone_get()?>
Expected result:
----------------
04-02-2013 10:07:03
04-02-2013 10:07:03 GMT
Actual result:
--------------
04-02-2013 12:07:03
04-02-2013 10:07:03 GMT
--
Edit bug report at https://bugs.php.net/bug.php?id=64155&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=64155&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=64155&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=64155&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64155&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64155&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64155&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64155&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64155&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64155&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64155&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64155&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64155&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64155&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64155&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64155&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64155&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64155&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64155&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64155&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64155&r=mysqlcfg