Bug #66903 [Opn]: strtotime - diff time zones
| From: | a dot dyudyun at gmail dot com | Date: | Fri, 14 Mar 2014 07:34:49 +0000 |
| Subject: | Bug #66903 [Opn]: strtotime - diff time zones | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-184784@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66903&edit=1
ID: 66903
User updated by: a dot dyudyun at gmail dot com
Reported by: a dot dyudyun at gmail dot com
Summary: strtotime - diff time zones
Status: Open
Type: Bug
Package: Date/time related
Operating System: Debian
PHP Version: 5.4.26
Block user comment: N
Private report: N
New Comment:
About results !!!
=================
Actual result:
----------------
Kiev:1394781415
New-York:1394781415
UTC:1394781415
==========================
Kiev:1394748000
New-York:1394769600
UTC:1394755200
Expected result:
--------------
Kiev:1394781415
New-York:1394781415
UTC:1394781415
==========================
Kiev:1394755200
New-York:1394755200
UTC:1394755200
Previous Comments:
------------------------------------------------------------------------
[2014-03-14 07:31:38] a dot dyudyun at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=66903&edit=1