-
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.
-
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.
-
how to find timezone?
thanks for the reply.
but tell me how to find the timezone.
thnaks.
Prashant T.
-
-
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!
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|