Oracle SYS_EXTRACT_UTC trying to understand -



Oracle SYS_EXTRACT_UTC trying to understand -

here 1 of our query in database, trying understand utc converstion in our query.

can 1 briefly explain, below query doing?

select cast (sys_extract_utc (cast ( (begin_date - (3 / 24)) timestamp)) date) begin_date offer o mask = 'ok'

after conversion output : 06-sep-11 04:00:00

select begin_date offer o mask = 'ok'

before conversion output : 06-sep-11 00:00:00

sys_extract_utc extracts utc (coordinated universal time—formerly greenwich mean time) datetime value time zone offset or time zone part name.

for example,

sql> select sys_extract_utc(timestamp '2014-11-05 12:00:00.00 -08:00') dt 2 dual; dt --------------------------------------------------------------------------- 05-nov-14 08.00.00.000000000 pm sql>

in case, timezone -08:00. so, -3/24 used.

for example, timezone +05:30. current time is,

sql> select to_char(sysdate, 'mm/dd/yyyy hh:mi:ss am') dt dual; dt ---------------------- 11/04/2014 01:12:21 pm sql>

the utc time equivalent is,

sql> select sys_extract_utc(timestamp '2014-11-05 01:12:21.00 +05:30') dt 2 dual; dt --------------------------------------------------------------------------- 04-nov-14 07.42.21.000000000 pm sql>

oracle

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -