tags:

views:

8

answers:

1

INFORMIX-SE:

SE allows you to create an audit file for any table. The audit file has the same schema as the table being audited plus a header consisting of several columns, one of them being a_time INTEGER, which contains a UNIX timestamp of when the row was added, updated or deleted. UNIX timestamp is an INTEGER value corresponding to the number of seconds since 1970-01-01T00:00:00Z. Can anyone come up with an algorithm which can accurately convert these seconds into a date and time?

+1  A: 

Here is an algorithm that shows you how to do it: http://forums.mrplc.com/index.php?showtopic=13294&view=findpost&p=65248

lrm
@lrm- looks good, however it's not accurate because it doesn't take into account leap seconds in UTC. My goal is to obtain accurate time of day to a precision of hh:mm so I dont know how many leap seconds have been added since 01-JAN-1970,T00:00:00Z.
Frank Computer
@Frank: POSIX does not take leap seconds into account, period. Unless you know that your system does - which seems a tad unlikely - don't worry about it. SE most certainly does not take leap seconds into account directly; it just relies on the system clock to tell it a number.
Jonathan Leffler