I'm trying to get the current GMT/UTC regardless of the time zones my current database is located. The possible solution I found is:
SELECT SYSTIMESTAMP AT TIME ZONE dbtimezone FROM DUAL;
and it is giving me the current GMT, but I am not 100% confident if this is the right way. Would anyone please help provide the best way to get the current GMT? Thanks.
If you want the current time in GMT, you'd want
SELECT systimestamp AT TIME ZONE 'GMT'
FROM dual
That will work regardless of the dbtimezone
.