How to see current time in America now?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: How to see current time in America now?

  1. #1
    Join Date
    Nov 2008
    Posts
    5

    How to see current time in America now?

    Hi All,
    I am in India and working with local timestamp.
    Now I want to the what time is there in America by a select query without doing any mathematical calculation.

    Thanks in advance.


    Prashant T.

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,554
    How about...

    Code:
    select TO_CHAR(new_time(sysdate,'GMT','PST'), 'DD-MON-YYYY HH:MI:SS') FROM DUAL;
    ... don't forget to replace GMT with your time zone.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Nov 2008
    Posts
    5

    how to find timezone?

    thanks for the reply.

    but tell me how to find the timezone.

    thnaks.

    Prashant T.

  4. #4
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,027
    this space intentionally left blank

  5. #5
    Join Date
    Nov 2001
    Posts
    335
    Do not use new_time, you will have a probem when there there will be timezone change from EST to EDT and back. Rather use systimestamp and get a gmt time , using offset from gmt which is not changing u can get a time in any timezone.

    This is gmt time:

    SELECT TO_CHAR(SYS_EXTRACT_UTC(systimestamp),'DD-Mon-YYYY HH24:MI:SS') into pGmtDate FROM DUAL
    One, who thinks that the other one who thinks that know and does not know, does not know either!

  6. #6
    Join Date
    Nov 2008
    Posts
    5
    thanks for reply. It works.

    if we know timezone abbreciation then we can find out the time anywhere.
    Please can you give me the query by which I can get abbreviations also.


    Thanks again.
    Prashant.

Posting Permissions

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


Click Here to Expand Forum to Full Width