What is the format of the UTC field? Does it have a date value, or is it just the time? Do you want to show the date, time, or datetime value of this field? Malcolm
wynden@telus.net
The field is a number field of length 38...I'm not sure how it is created..it is done by an in the box application..to which I have no access to the source code.
I would like to determine the date and time from this field
Here is an example of what the value of the field is...
938747887
Not sure if any of this helps...
I was under the impression that the UTC value is some number of seconds?? from a date in 1970 or something?
I thought it was Jan 1, 1972.
UTC has occasional leap seconds as well, so there is not a fixed number of seconds in day. You can ignore these and get a time that is very close to being right - i think there are only about 15 leap sec since time zero Malcolm
wynden@telus.net
OK...I've found out that the field is the current time in seconds and I would like to convert that into a workable date and time...is there an Oracle Function or an easy way to do this?
If it is truly UTC, then Ken's formula should do it (it was 1972 when the switch from GMT to UTC happened though) - you would be better off to do the conversion to a date in your database, as you can be assured that an Oracle back end is going to be several orders of magnitude faster than doing the conversion through SCR on the client.
About every second or third year has a leap second though, so unless you establish a table for leap seconds you will have a cumulative error of a few seconds.
There is an Oracle forum on Tek-Tips that would be able to give you some tips on the best conversion.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.