note 114629 deleted from function.strtotime by peehaa
| From: | peehaa@php.net | Date: | Fri, 06 Jan 2017 16:03:06 +0000 |
| Subject: | note 114629 deleted from function.strtotime by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208725@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
<?php
# strtotime() function with param "now" work only with UTC
# time zone (GMT) Grinvich, but param "midnight" work with
# local time zone
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>";
?>
result:
Kiev:1394781415
New-York:1394781415
UTC:1394781415
==========================
Kiev:1394748000
New-York:1394769600
UTC:1394755200