

PHP date bug 2013-10-27 - VladoVelkov

If you try:
echo date(&#x27;Y-m-d&#x27;,strtotime(&#x27;2013-10-27&#x27;)+86400);
you get 2013-10-27<p>If you try:
echo date(&#x27;Y-m-d&#x27;,strtotime(&#x27;2013-10-28&#x27;)+86400);
you get 2013-10-29<p>Tested on 3 different hosts. 
86400 = seconds per day.
======
mooism2
You live in the EU (or a country that has the same rules for summer/winter
time as the EU).

2013-10-27 was 25 hours long in such places, because the clocks went back. A
bare date is assumed to be midnight, and adding 24 hours only gets you to 11pm
in this case.

The bug is in your code, not in PHP.

I don't know whether PHP has functions for date arithmetic (as distinct from
time stamp arithmetic, which you are using). Alternatively you could try using
UTC, or some other timezone that lacks summer/winter time.

------
Jack5500
Why is this here?

~~~
RobAley
Because it's fashionable on HN to hate on PHP and find holes where possible.
The trouble is, as this poster found out, it helps to know what you're talking
about before you criticise something!

