DateTime wierdness
| From: | Martín Marqués | Date: | Thu, 29 Mar 2012 16:23:34 +0000 |
| Subject: | DateTime wierdness | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-317337@lists.php.net to get a copy of this message | ||
Can someone explain to me this weierdness I see when using the
DateTime module of PHP.
Here I send 14/14/2012 which is not a valid date, and I would expect
to recieve false, but instead, it looks like it wrapping to the next
year, as if 14 monthas are 1 year and 2 months. That isn't what's
supposed to happen, or is it?
$ echo "<?php var_dump(DateTime::createFromFormat('j/n/Y',
'14/14/2012')); ?> "|php
object(DateTime)#1 (3) {
["date"]=>
string(19) "2013-02-14 13:20:22"
["timezone_type"]=>
int(3)
["timezone"]=>
string(20) "America/Buenos_Aires"
}
--
Martín Marqués
select 'martin.marques' || '@' || 'gmail.com'
DBA, Programador, Administrador