php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78966 strtotime transform error with
Submitted: 2019-12-16 08:06 UTC Modified: 2020-01-20 17:10 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jackyxie007 at gmail dot com Assigned: derick (profile)
Status: Verified Package: Date/time related
PHP Version: Irrelevant OS: Linux Ubuntu 4.4.0-151-generic
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
33 + 16 = ?
Subscribe to this entry?

 
 [2019-12-16 08:06 UTC] jackyxie007 at gmail dot com
Description:
------------
With decimal length of 9 digits after the Datetime string(Eg: 2019-12-15T17:51:38.948471000Z), strtotime return false.

Test script:
---------------
<?php

$str = '2019-12-15T17:51:38.948471000Z';
var_dump(strtotime($str));

Expected result:
----------------
int(1576432298)

Actual result:
--------------
bool(false)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-16 09:41 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2019-12-16 09:41 UTC] cmb@php.net
Behavior confirmed: <https://3v4l.org/G8fdq>.

The documentation[1] doesn't mention any restriction on the number
of fractional digits, so this is either an implementation or a
documentation bug.

[1] <https://www.php.net/manual/en/datetime.formats.compound.php>
 [2020-01-20 17:10 UTC] girgias@php.net
-Assigned To: +Assigned To: derick
 [2020-01-20 17:10 UTC] girgias@php.net
Assigning derick to confirm if it's an implementation bug or a doc bug.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Nov 25 23:01:24 2020 UTC