Re: DateTime wierdness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


El día 29 de marzo de 2012 14:14, David OBrien <dgobrien@xxxxxxxxx> 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 {
>         return false;
>
>     }
> }

Well, I did somethin similar...

    $arDate = explode("/", $nacimiento);
    if(!checkdate($arDate[1], $arDate[0], $arDate[2]))
      $nacimiento = '';

Just need to set the variable $nacimiento to the empty string if it's
not a valid date.

Thanks anyway,


-- 
Martín Marqués
select 'martin.marques' || '@' || 'gmail.com'
DBA, Programador, Administrador

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [Find Someone]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux