Tuesday, February 14, 2012

Convert from unix time

One of my tables has an open_date and close_date that are stored in unix time. I added two other colums z_opendate and z_closedate and I now would like to convert open_date and close_date from unix time and populate the new colums I added.
Can anyone give me some insite on how to do this?
Thanks.
Eric,
Unix time is typically represented as the number of non-leap seconds
after midnight, January 1, 1970. If that's what you have (integers a
bit larger than 1,000,000,000), try using dateadd(second, open_date,
'19700101') to get a datetime representation of open_date, for example.
Steve Kass
Drew University
Eric wrote:

>One of my tables has an open_date and close_date that are stored in unix time. I added two other colums z_opendate and z_closedate and I now would like to convert open_date and close_date from unix time and populate the new colums I added.
>Can anyone give me some insite on how to do this?
>
>Thanks.
>
>

No comments:

Post a Comment