php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75460 Incorrect Timezone Behaviour
Submitted: 2017-10-30 10:15 UTC Modified: 2017-10-30 11:25 UTC
From: it at willowsv dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 7.1.11 OS: Windows 10 Apache 2.4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: it at willowsv dot com
New email:
PHP Version: OS:

 

 [2017-10-30 10:15 UTC] 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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-30 10:16 UTC] it at willowsv dot com
October sorry :)
 [2017-10-30 10:50 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2017-10-30 10:50 UTC] 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 11:25 UTC] it at willowsv dot com
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.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 23:01:33 2025 UTC