#34087 [Asn]: strtotime() does not work with date format "Y/m/d"

From: Date: Fri, 12 Aug 2005 07:24:53 +0000
Subject: #34087 [Asn]: strtotime() does not work with date format "Y/m/d"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83437@lists.php.net to get a copy of this message
ID: 34087 User updated by: osmium at 163 dot com Reported By: osmium at 163 dot com Status: Assigned -Bug Type: Feature/Change Request +Bug Type: Date/time related Operating System: Windows Server 2003 PHP Version: 5.1.0b3 Assigned To: derick New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2005-08-12 08:48:59] derick@php.net It's very easy to add though. ------------------------------------------------------------------------ [2005-08-12 05:03:49] ramsey@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The manual states that strtotime() parses a date/time string according to the GNU Date Input Formats syntax. The format "Y/m/d" is not a supported GNU date input format (see the link below). http://www.php.net/strtotime http://www.gnu.org/software/tar/manual/html_chapter/tar_7.html ------------------------------------------------------------------------ [2005-08-12 03:08:37] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34087&edit=1

« previous php.bugs (#83437) next »