How to get current GMT in Oracle

I am trying to get the current GMT / UTC, regardless of where the current database is located. A possible solution that I found is:

SELECT SYSTIMESTAMP AT TIME ZONE dbtimezone FROM DUAL; 

and it gives me the current GMT, but I'm not 100% sure if this is the right way. Anyone please help provide the best way to get your current GMT? Thanks.

+4
source share
1 answer

If you need current time in GMT, you need

 SELECT systimestamp AT TIME ZONE 'GMT' FROM dual 

This will work regardless of dbtimezone .

+11
source

Source: https://habr.com/ru/post/1402059/


All Articles