|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74797 strtotime() doesn't accept date with spaces in it
Submitted: 2017-06-22 14:15 UTC Modified: 2017-06-22 21:25 UTC
From: hofman dot tomas at gmail dot com Assigned:
Status: Open Package: Date/time related
PHP Version: Next Minor Version OS:
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: hofman dot tomas at gmail dot com
New email:
PHP Version: OS:


 [2017-06-22 14:15 UTC] hofman dot tomas at gmail dot com
It will be nice, that strtotime() function could parse date format with dots and spaces to. Now strtotime('22.6.2017') returns 1498082400, but typographicaly correct version strtotime('22. 6. 2017') returns false. In some languages/typographic convetions (like Czech or German) format with spaces is correct, but strtotime() not supports it. Is it possible to have also this one?

Test script:

echo var_dump(strtotime('22.6.2017'));
echo var_dump(strtotime('22. 6. 2017'));


Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-22 21:25 UTC]
strtotime can't possibly support *all* formats in existence, that's why you can use DateTime::createFromFormat instead:
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Mar 03 09:01:23 2021 UTC