|  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
Avg. Score:3.8 ± 0.9
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:1 (20.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
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.
Block user comment
Status: Assign to:
Bug Type:
From: up at co dot inbox dot lv
New email:
PHP Version: OS:


 [2007-08-30 12:37 UTC] up at co dot inbox dot lv
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:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-30 12:49 UTC]
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 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-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 13 06:01:30 2024 UTC