Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    1

    Unanswered: Time zones - convert local time to GMT

    I'm working with SQL 2000. The database server is located in the Pacific Time zone. Data will be collected from branches in other time zones (CT, MT, ET, etc.). Is there a stored procedure that can convert the timestamp on the data retrieved from different time zones into GMT?


    Thank you in advance.

  2. #2
    Join Date
    Feb 2003
    Location
    Denver, CO
    Posts
    34

    Re: Time zones - convert local time to GMT

    One option for writing your own SP would be to use SQL's DATEADD Function:

    DATEADD ( datepart, number, date )

    So DATEADD(Hour, 1, GetDate()) would add one hour to the current date and time, and DATEADD(Hour, -1, GetDate()) would subtract one hour ...

    Check it out on the MS website:

    http://msdn.microsoft.com/library/de...ce_dateadd.asp

  3. #3
    Join Date
    Feb 2003
    Location
    Denver, CO
    Posts
    34
    (follow up). Oops ... here's the right page for the version of SQL Server you are using:

    http://msdn.microsoft.com/library/de...da-db_3vtw.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •