Bug #75460 [Nab]: Incorrect Timezone Behaviour

From: Date: Mon, 30 Oct 2017 11:25:25 +0000
Subject: Bug #75460 [Nab]: Incorrect Timezone Behaviour
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212371@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75460&edit=1 ID: 75460 User updated by: it at willowsv dot com Reported by: it at willowsv dot com Summary: Incorrect Timezone Behaviour Status: Not a bug Type: Bug Package: Date/time related Operating System: Windows 10 Apache 2.4 PHP Version: 7.1.11 Block user comment: N Private report: N New Comment: Ah I see. I wasn't expecting midnight to return 11pm however I guess that would make sence if it was an hour out on that day. I will revisit and do some more testing. Previous Comments: ------------------------------------------------------------------------ [2017-10-30 10:50:28] requinix@php.net gmdate() formats a timestamp according to GMT/UTC+0. Europe/London was on UTC+1 until 2am Sunday morning. ------------------------------------------------------------------------ [2017-10-30 10:16:13] it at willowsv dot com October sorry :) ------------------------------------------------------------------------ [2017-10-30 10:15:07] it at willowsv dot com Description: ------------ This may be intended behaviour however the clocks went back on the 29th of November and all date related functions are returning the times minus 1 hour for the entire day (despite the timezone being UTC) Test script: --------------- <?php date_default_timezone_set( 'Europe/London' ); $tTime = strtotime("MIDNIGHT"); echo("Europe/London - " . time() . " - " . gmdate("d/m/Y H:i:s e", $tTime) . "<br />"); date_default_timezone_set( 'UTC' ); $tTime = strtotime("MIDNIGHT"); echo("UTC - " . time() . " - " . gmdate("d/m/Y H:i:s e", $tTime) . "<br />"); ?> Expected result: ---------------- Europe/London - 1509356919 - 30/10/2017 00:00:00 UTC UTC - 1509356919 - 30/10/2017 00:00:00 UTC In Both timezones settings. Actual result: -------------- 30th November Europe/London - 1509356919 - 30/10/2017 00:00:00 UTC UTC - 1509356919 - 30/10/2017 00:00:00 UTC 29th November Europe/London - 1509271023 - 28/10/2017 23:00:00 UTC UTC - 1509271023 - 29/10/2017 00:00:00 UTC ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75460&edit=1

« previous php.bugs (#212371) next »