Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Enterprise
Expertise: Beginner
Dec 12, 2001



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Finding the Time in Different Zones

These days, many enterprises exchange data using a request/response approach. This data typically contains the date and time information regarding when a request was generated/received or a response generated/received. If they are in different time zones the following code/query can help in finding out the times in their respective zones.
Select to_char(new_time(sysdate,'PST','EST'), _
'dd-mm-yy hh24:mi:ss') from dual;

This gives the Date and time in in East Coast for the corresponding time in PST. For example: 9.00 am in PST is given as:
SQL> select to_char(new_time(to_date('10/18/01 _
HH24:MI:SS'),'PST','EST'), 'dd-mm-
yy hh24:mi:ss') from dual;

18-10-01 12:00:00

This can be used for different time zones like GMT,CST, and so on. It can also be used when storing information about request/response times.
Srirama Chakka
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date