Subject | Re: [firebird-support] unix time |
---|---|
Author | Lester Caine |
Post date | 2004-10-15T10:11:01Z |
Helen Borrie wrote:
How the h**l do I get '1/1/1970' as a number since I can't apparently
CAST it to an integer.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
>>I've got to convert some data from a timestamp to a unix seconds timerOK the calculation is ( timestamp - '1/1/1970' ) * 86400
>>is it as simple as CAST (( timestamp * 24 * 60 * 60 ) + something AS
>>INTEGER ) or do I need a UDF to sort it out ;)
>
> It seems to depend on how much you care about "leap-seconds". The purists
> want you to use a complicated algorithm to take them into account; the PHP
> folk seem quite happy to take 1970-01-01 00:00:00 UHT as time zero and just
> add 86,000 per day + seconds since midnight.
How the h**l do I get '1/1/1970' as a number since I can't apparently
CAST it to an integer.
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services