Friday, March 1, 2019

Grabbing UTC Hour from Oracle

A simple sql script for obtaining gmt hour from Oracle
select sys_extract_utc(systimestamp) as UTC,
extract(hour from sys_extract_utc(systimestamp) ) as UTC_HOUR,
extract(hour from cast(to_char(sysdate, 'DD-MON-YYYY HH24:MI:SS') as timestamp) ) as  local_hour
from dual