M
M
maxz2013-01-18 15:56:38
PHP
maxz, 2013-01-18 15:56:38

Why is March 2013 one hour slower than March 2012 (PHP)?

Why does PHP show one hour less time in March 2013 than it did in March 2012?
The code for the calculation is simple:

echo strtotime('2012-03-01') - strtotime('2012-03-31')

At the same time, the results are amazing (shown by years, the corresponding year was substituted):
Март 2012 = 2588400 секунд
Март 2013 = 2592000 секунд
Март 2014 = 2588400 секунд
Март 2015 = 2588400 секунд
Март 2016 = 2588400 секунд
Март 2017 = 2588400 секунд
Март 2018 = 2588400 секунд
Март 2019 = 2592000 секунд
As you can see, the same story repeats itself in 2019. Of course, the last day is not taken into account here, but still, why do the same 30 days have a different number of seconds? Does anyone know why?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
PaulZi, 2013-01-18
@maxz

The point is the transfer of summer time on the last Sunday of March (which we have canceled).
strtotime converts the time to unixtimestamp, adding 3600 or not, respectively.

W
WEBIVAN, 2013-01-18
@WEBIVAN

Probably, in the selected time locale in 2013 and 2019, the transition to daylight saving time falls on March.

W
WildZero, 2013-01-18
@WildZero

Personally, I'm fine. For all months, the result is 259200. Which, in principle, is correct.
php 5.4.9

O
OnYourLips, 2013-01-19
@OnYourLips

Something tells me that the matter is in the ancient version of PHP.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question