Solved

Converting 'timestamp with time zone' into 'timestamp' datatype..

Posted on 2011-09-07
6
608 Views
Last Modified: 2012-05-12
i have data with 'TIMESTAMP(6) WITH TIME ZONE' ...
2 example values:
02/10/2011 12:05:05.000000 AM -05:00
05/17/2011 03:20:19.000000 AM -04:00
can you give a query to convert this into TIMESTAMP datatype after adding the TZR value..?
0
Comment
Question by:Rao_S
  • 3
  • 2
6 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
What is the desired output?
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
Comment Utility
if you're just trying to get the GMT time


CAST(SYSTIMESTAMP AT TIME ZONE 'GMT' AS TIMESTAMP)
0
 

Author Comment

by:Rao_S
Comment Utility
thanks sdstuber, that is what i what looking for....
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 73

Assisted Solution

by:sdstuber
sdstuber earned 500 total points
Comment Utility
if you "really" wanted to do the offset math yourself you could do it like this...



   CAST(SYSTIMESTAMP AS TIMESTAMP)
       - NUMTODSINTERVAL(EXTRACT(TIMEZONE_HOUR FROM SYSTIMESTAMP), 'hour')
       - NUMTODSINTERVAL(EXTRACT(TIMEZONE_MINUTE FROM SYSTIMESTAMP), 'minute')


but,  I recommend using the "AT TIME ZONE" method, simpler and more efficient.

as above,  use your own timestamp value for systimestamp
0
 

Author Comment

by:Rao_S
Comment Utility
thank you...i like the 'at time zone' also.....!...
0
 

Author Closing Comment

by:Rao_S
Comment Utility
thank you...
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now