|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-10-18 15:10 UTC] writejohnemail at gmail dot com
-Status: Open
+Status: Closed
[2019-10-18 15:10 UTC] writejohnemail at gmail dot com
[2019-10-18 15:13 UTC] requinix@php.net
-Status: Closed
+Status: Not a bug
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 16:00:01 2025 UTC |
Description: ------------ In time zones that make a daylight savings change at midnight, on the day of the daylight savings change, ->modify('-1 second') does not work as expected. America/Santiago, America/Havana, Asia/Tehran, America/Asuncion are a few of the time zones that have this behavior Test script: --------------- $timezone = 'America/Santiago'; $dateString = "2020-09-06"; $dt = new \DateTime($dateString); $dtz = new \DateTimeZone($timezone); $dt->setTimezone($dtz); echo 'the start of the day:<br>'; $dt->modify('today'); echo $dt->getTimestamp(); echo '<br><br>the start of the day, minus one second. this is incorrect:<br>'; $dt->modify('-1 second'); echo $dt->getTimestamp(); Expected result: ---------------- 1599364799 Actual result: -------------- 1599368399