6

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.

Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133
user1056038
  • 63
  • 1
  • 2
  • 4

1 Answers1

15

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.

Justin Cave
  • 227,342
  • 24
  • 367
  • 384