Bug #66903 [NEW]: strtotime - diff time zones
| From: | a dot dyudyun at gmail dot com | Date: | Fri, 14 Mar 2014 07:31:39 +0000 |
| Subject: | Bug #66903 [NEW]: strtotime - diff time zones | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-184783@lists.php.net to get a copy of this message | ||
From: a dot dyudyun at gmail dot com
Operating system: Debian
PHP version: 5.4.26
Package: Date/time related
Bug Type: Bug
Bug description:strtotime - diff time zones
Description:
------------
# strtotime() function with param "now" work only with UTC
# time zone (GMT) Grinvich, but param "midnight" work with
# local time zone
Test script:
---------------
<?php
date_default_timezone_set("Europe/Kiev");
echo "Kiev:".strtotime("now");
echo "<br><br>";
date_default_timezone_set("America/New_York");
echo "New-York:".strtotime("now");
echo "<br><br>";
date_default_timezone_set("UTC");
echo "UTC:".strtotime("now");
echo "<br>==========================<br>";
date_default_timezone_set("Europe/Kiev");
echo "Kiev:".strtotime("midnight");
echo "<br><br>";
date_default_timezone_set("America/New_York");
echo "New-York:".strtotime("midnight");
echo "<br><br>";
date_default_timezone_set("UTC");
echo "UTC:".strtotime("midnight");
echo "<br><br>";
?>
Expected result:
----------------
Kiev:1394781415
New-York:1394781415
UTC:1394781415
==========================
Kiev:1394748000
New-York:1394769600
UTC:1394755200
Actual result:
--------------
result:
Kiev:1394781415
New-York:1394781415
UTC:1394781415
==========================
Kiev:1394755200
New-York:1394755200
UTC:1394755200
--
Edit bug report at https://bugs.php.net/bug.php?id=66903&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66903&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66903&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66903&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66903&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66903&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66903&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66903&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66903&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66903&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66903&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66903&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66903&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66903&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66903&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66903&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66903&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66903&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66903&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66903&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66903&r=mysqlcfg