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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With