Tuesday, March 27, 2012

Convert 1084313300 (Ten Digit) value to Datetime

I have a field in a table that contains ten digit value representing a datetime. Is there any way to convert it to default datetime format
Thanks

--
Message posted via http://www.sqlmonster.comHi,
Whats the column data type. is it int or varchar?? what's the date that
reprasenting 1084313300 ??

Cheers
Dishan|||On Thu, 23 Dec 2004 02:04:02 GMT, Imran Irfan via SQLMonster.com wrote:

> I have a field in a table that contains ten digit value representing a datetime. Is there any way to convert it to default datetime format
> Thanks

I'm guessing that it represents a unix time. If that's true, you want

select dateadd(second,1084313300,'1970-01-01')
which returns
2004-05-11 22:08:20.000

You may want or need timezone corrections as well...

No comments:

Post a Comment