Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 559429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:14:13+00:00 2026-05-13T12:14:13+00:00

I have a table with two columns of GMT time in seconds, and offset

  • 0

I have a table with two columns of GMT time in seconds, and offset in minutes like this:

  SELECT TOP 1 StartTime, OffSet FROM MyTable;
  1247242537  -420 -- as example

What SQL function I can use to convert it to a datetime in yyyy-MM-dd hh:mm:ss as TimeStamp? The SQL I am using is SQL Server 2005.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:14:13+00:00Added an answer on May 13, 2026 at 12:14 pm

    This should do it, assuming you Epoch date is 1/1/1970 (usually for GMT seconds, but you will need to confirm)

    select dateAdd(ss,1247242537+(-420*60),'1/1/1970') 
     == >  2009-07-10 09:15:37.000
    

    For you code, use

    select DATEADD(ss,StartTime+(Offset*60),'1/1/1970') as TheTime FROM myTable
    

    Be sure you find some test cases to make sure the Epoch date is as expected. Basically, the GMT time is number of seconds past 1/1/1970 12:00am, so DateAdd handles that part. The offset is the number of minutes different from GMT, so multiply that by 60 to get seconds and adjust your value to DateAdd accordingly

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have SP that selects data from a table with two columns like this
I have Table with two smalldatetime columns, where one is startTime and other one
I have a table with two columns, userID and contentID. Basically this table is
Suppose I have table with two columns. I can center this table by using:
I have a table that has two columns, ID and Value. For this example
Say I have an MSSQL table with two columns: an int ID column that's
Suppose I have a tags table with two columns: tagid and contentid . Each
I have a table y Which has two columns a and b Entries are:
I have a table that holds only two columns - a ListID and PersonID.
I have a table, call it TBL. It has two columns,call them A and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.