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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC