Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2003
    Posts
    30

    Unanswered: Converting a date from one timezone to another timezone

    Hi,
    I have a requirement for a function which would convert a given date with a present timezone to a new timezone.

    For eg : the function would be called lets say TZ

    then I can issue the following select statement to get the new timezone

    select getdate(), TZ(getdate(), PST, EST)

    where PST is the current timezone and EST is the new timezone.

    I know that ORACLE has a built in function to do this. Am just wondering if theres some function that I can use to accomplish the task.

    Thanks
    -soumil

  2. #2
    Join Date
    Sep 2003
    Posts
    522
    you can write your own function using info from this site.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    This is a real pain-in-the-butt to do, not just because of all the time zones, but because even within a time-zone some areas may use Daylight Savings Time, and some may not.

    I had to deal with this when I designed an EDI tracking application. In the end we decided it was best to always output the data in GMT and then let the webpage translate it to whatever local time the page was being viewed in. For incoming data, I required all events to include a time stamp from their point of origin, and then I added a local time stamp. By comparing the two values we were able to synchronize events across time-zones without even caring what zone they came from, and it accounted for discrepancies in system-clock times as well.

    I hope you can use some work-around like this, or find someone who has already written the procedure/function for you.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Jan 2003
    Location
    India
    Posts
    523
    there is one already written by tara check it out:
    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=28712
    harsh.

Posting Permissions

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