php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28717 strtotime() not handling fractions of seconds
Submitted: 2004-06-10 00:31 UTC Modified: 2004-06-11 17:30 UTC
Votes:7
Avg. Score:3.7 ± 1.3
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:2 (40.0%)
From: andy at advancethermal dot com Assigned:
Status: Wont fix Package: Date/time related
PHP Version: 4.3.7 OS: WindowsXP
Private report: No CVE-ID: None
 [2004-06-10 00:31 UTC] andy at advancethermal dot com
Description:
------------
strtotime() returns -1 for dates in the format yyyy-mm-dd hh:mm:ss.fff  (where .fff represents the fraction of the second)

e.g. strtotime("2004-06-09 17:25:14.333") returns -1

[MSSQL via ODBC returns dates in this format.]


Reproduce code:
---------------
$sv = strtotime("2004-06-09 17:25:14.333");
echo $sv;

Expected result:
----------------
1086819914

Actual result:
--------------
-1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-10 09:00 UTC] derick@php.net
This is fixed for PHP 5, but will not be fixed in PHP 4.
 [2004-06-11 17:20 UTC] php1 at clayst dot com
OK, won't be fixed is fine, but the docs should be updated.  Took me a while to track this down as I believed the docs that GNU format was the rule.  GNU format allows the decimal seconds.
 [2004-06-11 17:30 UTC] derick@php.net
Yup the docs for this should be fixed too; but I'll do that after I fixed the code for PHP 5 ;-)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 00:01:32 2024 UTC