dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


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

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


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 _
9:00:00','MM/DD/YY
HH24:MI:SS'),'PST','EST'), 'dd-mm-
yy hh24:mi:ss') from dual;

TO_CHAR(NEW_TIME(
-----------------
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.

 

 

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