Convert int column into datetime

all date columns in this db are defined as int and look weird. normally i would expect 8 digits (for YYYYMMDD) something like 20080131
but these have 10 digits and look weird. if i run
select top 10 myDateColumn from myTable order by myDateColumn desc  
it returns like:
1201820136
1201820052
1201820051
etc

could you show me how to extract a proper datetime from this?
LVL 2
iamariAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris MangusDatabase AdministratorCommented:
It's seconds after 1/1/1970.

Try:

Select Top 10 DateAdd(ss, myDateColumn, '1/1/1970')
From myTable
Order by myDateColumn Desc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
iamariAuthor Commented:
geez, thanks a lot cmangus, works just fine!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.