You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the from 11-1 to 11-4, Daylight Saving time ends. If you change the time by adding a DateInterval, it gets it right, but it gets it wrong with modify. Also note that if instead of adding 72 hours, you add 3 days, the inconsistency goes away--DateInterval understands, apparently, that one of those days is 25 hours, and adjusts correctly (at least, it seems correct to me) to Midnight on 11-4.
PHP Version
PHP 8.3
Operating System
No response
The text was updated successfully, but these errors were encountered:
karptonite
changed the title
DateTimeImmutable (and DateTime) Modify does not respect Daylight Saving Time shifts
DateTimeImmutable (and DateTime) modify does not respect Daylight Saving Time shifts
Sep 13, 2024
Description
The following code:
Resulted in this output:
But I expected this output instead:
Note that the from 11-1 to 11-4, Daylight Saving time ends. If you change the time by adding a DateInterval, it gets it right, but it gets it wrong with modify. Also note that if instead of adding 72 hours, you add 3 days, the inconsistency goes away--DateInterval understands, apparently, that one of those days is 25 hours, and adjusts correctly (at least, it seems correct to me) to Midnight on 11-4.
PHP Version
PHP 8.3
Operating System
No response
The text was updated successfully, but these errors were encountered: