Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2008
    Posts
    94

    Unanswered: Convert SYSDATE to GMT timezone?

    Oracle Version:- Oracle Database 11g
    Im trying the below function to convert. However im trying to identify the timezone in the server automatically including daylight saving time to convert to GMT time.

    Code:
    SELECT NEW_TIME(SYSDATE, 'IST', 'GMT') FROM DUAL
    Can you please provide some suggestion to achive this logic.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Quote Originally Posted by laknar View Post
    Oracle Version:- Oracle Database 11g
    Im trying the below function to convert. However im trying to identify the timezone in the server automatically including daylight saving time to convert to GMT time.

    Code:
    SELECT NEW_TIME(SYSDATE, 'IST', 'GMT') FROM DUAL
    Can you please provide some suggestion to achive this logic.

    SYSDATE contains NO timezone detail; so you can't get there from here.
    you need to start with a datatype which already is timezone aware.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    As long as your code will never run on Oracle 8 or earlier, you could use:
    Code:
    SELECT sys_extract_utc(systimestamp) FROM dual;
    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

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