2012/3/29 Martín Marqués :
> El día 29 de marzo de 2012 14:14, David OBrien escribió:
>> actually this would work well ... compare what they send with the output of
>> the formatdate
>>
>> function checkDateTime($data) {
>> if (date('Y-m-d H:i:s', strtotime($data)) == $data) {
>> retur
El día 29 de marzo de 2012 14:14, David OBrien escribió:
> actually this would work well ... compare what they send with the output of
> the formatdate
>
> function checkDateTime($data) {
> if (date('Y-m-d H:i:s', strtotime($data)) == $data) {
> return true;
> } else {
> re
actually this would work well ... compare what they send with the output of
the formatdate
function checkDateTime($data) {
if (date('Y-m-d H:i:s', strtotime($data)) == $data) {
return true;
} else {
return false;
}
}
2012/3/29 David OBrien
> http://www.php.net/manual
http://www.php.net/manual/en/function.checkdate.php
2012/3/29 Martín Marqués
> OK. So what would be a good way to validate a date?
>
> El día 29 de marzo de 2012 14:04, David OBrien
> escribió:
> >
> > echo date("m-d-y",mktime(0, 0, 0, 14, 14, 2012));
> >
> > this outputs "02-14-13" also so my
OK. So what would be a good way to validate a date?
El día 29 de marzo de 2012 14:04, David OBrien escribió:
>
> echo date("m-d-y",mktime(0, 0, 0, 14, 14, 2012));
>
> this outputs "02-14-13" also so my guess is that it is being interpreted the
> same as "12/14/2012 +2 months"
>
> echo date("m-d-
echo date("m-d-y",mktime(0, 0, 0, 14, 14, 2012));
this outputs "02-14-13" also so my guess is that it is being interpreted
the same as "12/14/2012 +2 months"
echo date("m-d-y",mktime(0, 0, 0, 1, 45, 2012)); outputs
"02-14-12"
which is 1/1/12 +45 days
2012/3/29 Martín Marqués
> Can someone
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
suppose
7 matches
Mail list logo