How to convert TIMESTAMP_WITH_TIMEZONE to GMT TIMESTAMP in ORACLE SQL -


we have field of timestamp_with_timezone(oracle sql) type , has data of different time zones. example:

25-jun-16 09.15.00.000000000 +08:00 30-jul-16 10.00.00.000000000 +03:00 

now have convert each timestamp(of different time zones) in table timestamp of gmt time zone. these updates should done through procedure.

we tried use sys_extract_utc function, getting error:

  1. 00000 - "not valid month"

query:

select sys_extract_utc(timestamp '30-jul-16 10.00.00.000000000 +03:00') dual; 

use below query

select timestamp time zone '2012-07-02 10:00:00-04' @ time zone 'gmt'; 

result

------------------------------

2012-07-02 14:00:00 (1 row)


select timestamp time zone '2012-07-02 14:00:00-00' @ time zone 'edt'; 

result

------------------------------

2012-07-02 10:00:00 (1 row)


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -