php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34087 strtotime() does not work with date format "Y/m/d"
Submitted: 2005-08-12 03:08 UTC Modified: 2005-08-31 14:37 UTC
From: osmium at 163 dot com Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5CVS-2005-08-08 OS: *
Private report: No CVE-ID: None
 [2005-08-12 03:08 UTC] osmium at 163 dot com
Description:
------------
I got nothing on the first line but a number "1123804800" on the second line. Maybe format "Y/m/d" is not supported by strtotime().

However, I got two numbers in v5.0.3

Reproduce code:
---------------
<?php
echo "Y/m/d: ", strtotime("2005/8/12"), "<br>";
echo "Y-m-d: ", strtotime("2005-8-12");
?>

Expected result:
----------------
Y/m/d: 1123804800
Y-m-d: 1123804800

Actual result:
--------------
Y/m/d: 
Y-m-d: 1123804800

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-12 08:48 UTC] derick@php.net
It's very easy to add though.
 [2005-08-12 09:24 UTC] osmium at 163 dot com
I'm so sorry for ignoring that. You know, "Y/m/d" works in v4.3 and v5.0, so I took it for granted.

And I thought "Y/m/d" is still widely used in this world.
 [2005-08-31 14:37 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 10:01:32 2024 UTC