Re: reading timestamp from audit trail files (SOLUTION)
Posted in 1996
Also thanks for the summary, allways greate. Just a comment that I actually tested my suggestion at the time, and again now, and it works on my OnLine 7.10.UC1: select extend (mdy(1,1,1970), year to second) + ww units second from table_where_data_is Yours is of course as good as long as it is a datetime which has a fixed format for the literal version. Don't ever do that with a date as if someone sets the DBDATE variable it may no longer work. And the probability for that happening as we approach year 2000 isn't all that low even inside the USA. amerop@netrus.net (Kleanthis Goozis) wrote: ...snip... :SOLUTION: select datetime(1970-01-01 00:00:00) year to second + a_time units second from .... :NOTE: The datetime value returned is Greenwich Time, therefore to convert to for example : U.S.Eastern Time you have to subtract 4*60*60 from a_time (4 hrs difference). : i.e. select datetime(1970-01-01 00:00:00) year to second + (a_time - 4*60*60) units second from .... :I would to thank everybody who responded to my posting. :Nils Myklebust proposed solution looks correct but not allowed by the Informix SQL syntax parser :(that's where I was having problems to begin with; I couldn't come up with the correct syntax). :However, I borrowed the "a_time units second" part from him. :John Prideaux's Stored Procedure works fine, but the above solution is much sorter and more :elegant. :Kleanthis Nils.Myklebust@ccmail.telemax.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company