php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61215 DateTime function error
Submitted: 2012-03-01 08:47 UTC Modified: 2012-03-01 09:48 UTC
From: luca450mhz at inwind dot it Assigned:
Status: Not a bug Package: Date/time related
PHP Version: Irrelevant OS: Windows 7 64bit
Private report: No CVE-ID: None
 [2012-03-01 08:47 UTC] luca450mhz at inwind dot it
Description:
------------
---
From manual page: http://www.php.net/datetime.construct
---
I have this error:

Message: Error parsing date/time value: '29/02/2012' [wrapped: DateTime::__construct() [datetime.--construct]: Failed to parse time string (29/02/2012) at position 0 (2): Unexpected character] 

The year 2012 is a leap year, and the date 2012/02/29 it's correct!
This error occurs in a writing operation on the database; I am using framework Propel for this.

Expected result:
----------------
I expect no error with dates of a leap years


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-01 09:48 UTC] salathe@php.net
Your date format d/m/Y is not supported, the value "29/02/2012" was taken to have 
m/d/Y format and with that format it is invalid.  Examples that would have worked 
include 29-02-2012, 29.02.2012, 2012/02/29 and 02/29/2012.

Available date formats are listed at 
http://php.net/manual/en/datetime.formats.date.php
 [2012-03-01 09:48 UTC] salathe@php.net
-Status: Open +Status: Not a bug -Package: *Data Exchange functions +Package: Date/time related
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 17:01:31 2024 UTC