Subject Re: [firebird-support] unix time
Author Lester Caine
Helen Borrie wrote:

>>I've got to convert some data from a timestamp to a unix seconds timer
>>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.

OK the calculation is ( timestamp - '1/1/1970' ) * 86400
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