php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42486 strtotime() fails with UT timezone
Submitted: 2007-08-30 12:37 UTC Modified: 2007-08-30 13:14 UTC
Votes:5
Avg. Score:4.0 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: up at co dot inbox dot lv Assigned:
Status: Wont fix Package: Unknown/Other Function
PHP Version: 5.2.4RC3 OS: Gentoo Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-08-30 12:37 UTC] up at co dot inbox dot lv
Description:
------------
strtotime() returns false if timezone is set to UT, it worked in php4 but is broken in php5

Reproduce code:
---------------
<?php print strtotime('Tue, 21 Aug 2007 06:23:46 UT'); ?>

Expected result:
----------------
On PHP Version 4.4.1:
1187677426

Actual result:
--------------
Empty

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-30 12:49 UTC] derick@php.net
UT is not really a easy measurable timezone, unlike UTC. To support this correctly we should take care of leapseconds, and this is very much something you don't want to do. See http://en.wikipedia.org/wiki/DUT1 for what is different between UTC and UT.
 [2007-08-30 13:14 UTC] up at co dot inbox dot lv
Ok, I believe the user, that have sent me an email message with the "Tue, 21 Aug 2007 06:23:46 UT" in the Date: header not mentioned this "Earth Rotation" timezone :D I suspect there's a bug in some mailing software, kind of missing "C" char after "UT".

From the link that you provided I see that difference between UT1 &#8722; UTC is allways less than one second, but strtotime() returns result exactly in seconds, not so precise. So by replacing "UT" string by "UTC" before parsing the date, we should get exactly the same time. I think this is more a documentation issue, but users will never meet this bug again.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Aug 24 22:01:26 2019 UTC