note 111286 added to function.date-create
| From: | MartonBodonyi | Date: | Sat, 02 Feb 2013 04:34:58 +0000 |
| Subject: | note 111286 added to function.date-create | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-193494@lists.php.net to get a copy of this message | ||
If you are getting an error like this:
Exception: DateTime::__construct(): Failed to parse time string (13/02/2013) at position 0 (1):
Unexpected character in DateTime->__construct()
Note that when you create a new date object using a format with slashes and dashes (eg 02-02-2012 or
02/02/2012) it must be in the mm/dd/yy(yy) or mm-dd-yy(yy) format (rather than british format
dd/mm/yy)! Months always before years (the american style) otherwise you'll get an incorrect
date and may get an error like the one above (where PHP is crashing on trying to decode a 13th
month).
Can catch you off guard because everything seems to be working fine and dandy until you hit a value
over 12.
----
Server IP: 69.147.83.199
Probable Submitter: 124.149.80.186
----
Manual Page -- http://php.net/manual/en/function.date-create.php
Edit -- https://master.php.net/note/edit/111286
Del: integrated -- https://master.php.net/note/delete/111286/integrated
Del: useless -- https://master.php.net/note/delete/111286/useless
Del: bad code -- https://master.php.net/note/delete/111286/bad+code
Del: spam -- https://master.php.net/note/delete/111286/spam
Del: non-english -- https://master.php.net/note/delete/111286/non-english
Del: in docs -- https://master.php.net/note/delete/111286/in+docs
Del: other reasons-- https://master.php.net/note/delete/111286
Reject -- https://master.php.net/note/reject/111286
Search -- https://master.php.net/manage/user-notes.php