Solved

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

Posted on 2011-09-07
6
609 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)
ID: 36498192
What is the desired output?
0
 
LVL 73

Accepted Solution

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


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

Author Comment

by:Rao_S
ID: 36498223
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
ID: 36498232
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
ID: 36498258
thank you...i like the 'at time zone' also.....!...
0
 

Author Closing Comment

by:Rao_S
ID: 36505022
thank you...
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
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.

815 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

13 Experts available now in Live!

Get 1:1 Help Now