Here is my code:
<?php
echo date("Y-m-d H:i:s",1477785600) ;
echo "<br />";
echo date("Y-m-d H:i:s",1477789200) ;
?>
and result is
2016-10-30 02:00:00
2016-10-30 02:00:00
Why does date() get the same result with different timestamps?
Is that a PHP bug?
My environment setting is:
That's the correct output. In Western Europe, on 30 October 2016 it was 2:00 twice due to daylight saving time:
It was first 2:00 CEST (+0200).
One hour later, at 3:00, the clock was reset one hour and it was 2:00 CET (+0100).
Here's a slightly clearer test case:
date_default_timezone_set('Europe/Berlin');
echo date("r",1477785600) . "
";
echo date("r",1477789200) ;
Sun, 30 Oct 2016 02:00:00 +0200
Sun, 30 Oct 2016 02:00:00 +0100