php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33056 strtotime() does not parse '20050518t090000'
Submitted: 2005-05-18 14:58 UTC Modified: 2005-06-16 01:24 UTC
From: dcturner2000 at yahoo dot co dot uk Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5.0.3 OS: Linux
Private report: No CVE-ID: None
 [2005-05-18 14:58 UTC] dcturner2000 at yahoo dot co dot uk
Description:
------------
strtotime('20050518t090000Z') returns -1 and should return 
1116406800 
 
Further experimentation seems to suggest that any time in 
that format whose tens-of-hours digit is 0 results in -1. 
 
 

Reproduce code:
---------------
echo strtotime('20050518t090000Z')."\n";
echo strtotime('20050518t091234Z')."\n";
echo strtotime('20050518t191234Z')."\n";
echo strtotime('20050518t090000')."\n";
echo strtotime('20050518t091234')."\n";
echo strtotime('20050518t191234')."\n";


Expected result:
----------------
1116406800 
1116407554 
1116443554 
1116403200 
1116403954 
1116439954 
 
[Of course, some of that depends what time zone you're in] 

Actual result:
--------------
-1 
-1 
1116443554 
-1 
-1 
1116439954 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-16 01:24 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

fixed in php 5.1
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC