Home » SQL & PL/SQL » SQL & PL/SQL » Comparing dates in different time zones
Comparing dates in different time zones [message #233325] Wed, 25 April 2007 12:52 Go to next message
artmt
Messages: 32
Registered: October 2006
Location: Boston
Member
I need to compare two dates (both of DATE data type). One is in GMT, the other one - in EST.
How do I convert the EST date to show the corresponding GMT value?

Thanks.
Art
Re: Comparing dates in different time zones [message #233326 is a reply to message #233325] Wed, 25 April 2007 13:07 Go to previous messageGo to next message
Michel Cadot
Messages: 64120
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use TZ_OFFSET function:
SQL> select tz_offset('EST') from dual;
TZ_OFFS
-------
-05:00

1 row selected.

Regards
Michel
Re: Comparing dates in different time zones [message #233327 is a reply to message #233325] Wed, 25 April 2007 13:10 Go to previous message
compcoder
Messages: 30
Registered: April 2007
Location: Maryland USA
Member
Try something like this

SELECT NEW_TIME(TO_DATE('11-10-99 01:23:45','MM-DD-YY HH24:MI:SS'), 'EST', 'GMT') "New Date and Time" FROM dual;
Previous Topic: Help with analytical function
Next Topic: trigger to call a batch file
Goto Forum:
  


Current Time: Tue Dec 06 12:04:18 CST 2016

Total time taken to generate the page: 0.20369 seconds