Re: TimeStamp BEFORE 1970

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

 



Hi Folks,

Well I think I got it, at least it's working more or less to me now...
I really would appreciate any comments or suggestions.

    function str2time($input = '12/31/1969')
    {
        if(($output = strtotime($input)) !== -1)
        {
            return $output;
        }
        else
        {
            preg_match('([0-2][0-9][0-9][0-9])', $input, $year);
            preg_replace('([0-2][0-9][0-9][0-9])', '1976', $input);
return floor(strtotime($input) + (($year[0] - 1976) * (31557376.189582)));
        }
    }

Thanks a lot!

Best Regards,
Bruno B B Magalhaes

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux