convert varchar UTC to human datetime

Hello, i have a column in my database that is a varchar, and I am trying to convert it to a date time the time is in UTC, and I need to get this into Human read date time.

time stamp
1488219517998


SQL that returns the wrong dates
Select 
CAST(SWITCHOFFSET(CAST(DATEADD(SECOND,CONVERT(bigint, CreateTime) /1000 + CONVERT(bigint, CreateTime) % 1000 + 8*60*60, '19700101') AS DATETIMEOFFSET),'-05:00') AS DATETIME2)
from ME_API_Requests_History
WHERE Technician = 'chris jones'
AND Status = 'Open'

Open in new window

LVL 1
Chris JonesLead Application Web DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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

Scott PletcherSenior DBACommented:
Maybe this?:

Select CAST(DATEADD(HOUR, -5, DATEADD(SECOND, CAST(CreateTime as bigint)/1000, '19700101')) AS datetime2) AS datetime
From (
    Select CAST(1488219517998 AS bigint) AS CreateTime
) AS sample_data
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
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
SQL

From novice to tech pro — start learning today.