1

When trying to create DateInterval with 2376000 seconds (exactly 660 hours), newly created object returns interval equal to 659 hours. It works fine for smaller numbers, but above certain value it just loses somewhere 1 hour.

$interval = new DateInterval('PT2376000S');

What it returns:

DateInterval {
 interval: + 27d 11:00:00.0
 +"s": 2376000
}

Using PHP 7.4.

Filip Kaszczyński
  • 139
  • 1
  • 2
  • 15
  • 3
    Where are you? DST changes are coming up, with some on Oct 31st, and some on November 7th. https://www.timeanddate.com/time/dst/2021.html – aynber Oct 06 '21 at 14:09
  • @aynber You're right, wow, I completely ignored this fact. The missing hour starts appearing exactly on 31st October. Thank you. – Filip Kaszczyński Oct 06 '21 at 14:26

0 Answers0