Req #74797 [NEW]: strtotime() doesn't accept date with spaces in it
| From: | hofman dot tomas at gmail dot com | Date: | Thu, 22 Jun 2017 14:15:12 +0000 |
| Subject: | Req #74797 [NEW]: strtotime() doesn't accept date with spaces in it | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209627@lists.php.net to get a copy of this message | ||
From: hofman dot tomas at gmail dot com
Operating system:
PHP version: Next Minor Version
Package: Date/time related
Bug Type: Feature/Change Request
Bug description:strtotime() doesn't accept date with spaces in it
Description:
------------
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:
---------------
<?php
echo var_dump(strtotime('22.6.2017'));
echo var_dump(strtotime('22. 6. 2017'));
?>
Expected result:
----------------
int(1498082400)
int(1498082400)
Actual result:
--------------
int(1498082400)
bool(false)
--
Edit bug report at https://bugs.php.net/bug.php?id=74797&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74797&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74797&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74797&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74797&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74797&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74797&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74797&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74797&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74797&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74797&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74797&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74797&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74797&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74797&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74797&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74797&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74797&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74797&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74797&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74797&r=mysqlcfg