Showing posts with label digit. Show all posts
Showing posts with label digit. Show all posts

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.com
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
Please don't multipost. Cross-post the message to multiple groups
instead if you think multiple groups are necessary. See my repsonse in
"Clients"
David
sqlsql

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...

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.
Plese Help me
Thanks
Message posted via http://www.sqlmonster.com
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. Plese Help me
> Thanks
We would need to know what format the 10 digit value was using in order
to convert it. Do you know what it is using? How do you currently
interpret the value in your application? i.e. is there an algorithm in
the application that clearly shows what's being done at the application
level?
David Gugick
Imceda Software
www.imceda.com
|||I assume that is a UNIX timestamp (seconds since 01/01/1970):
http://www.aspfaq.com/show.asp?id=2451
Jacco Schalkwijk
SQL Server MVP
"Imran Irfan via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:b4d9fd153fd8404c87ca2328c54bcbd9@.SQLMonster.c om...
>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.
> Plese Help me
> Thanks
> --
> Message posted via http://www.sqlmonster.com