|  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
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-06-10 00:31 UTC] andy at advancethermal dot com
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:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-10 09:00 UTC]
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]
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: Sun Jul 21 07:01:28 2024 UTC