gtjr921
Programmer
- Aug 30, 2006
- 115
I have a date field that is stored as an INT (yes an INT) I hate it,it's a 3rd party db. IT stores the date the same way some unix systems do.
IT stores the number of seconds since the epoch, or 1 January 1970. I am able to convert the int to date, but the time is off. It is actually ahead by 5 hours.
Example for this datetime as an int 1163517315
i get 2006-11-14 15:15:15.000, the correct time should be 10:16 am
the code i used to create my table is
how can i correct this.
thanks
IT stores the number of seconds since the epoch, or 1 January 1970. I am able to convert the int to date, but the time is off. It is actually ahead by 5 hours.
Example for this datetime as an int 1163517315
i get 2006-11-14 15:15:15.000, the correct time should be 10:16 am
the code i used to create my table is
Code:
alter TABLE [CDRMAin] add
[starttimetimecalc] AS
dateadd(second, endtime, '1 January 1970')
how can i correct this.
thanks