Purpose
This function returns the current date in the current session time zone, including the current time zone information.
Syntax
CURRENT_TIMESTAMP[ (precision)]
Parameters
precision specifies the precision of the seconds in decimal places, which is an integer in the range of [0,9]. It is optional. The default value is 6.
Return type
TIMESTAMP WITH TIME ZONE data type that contains the current time zone information.
Examples
Set the current session time zone to GMT-5, return the current session time and session time zone information, and adjust the precision of the seconds to
2.obclient> ALTER SESSION SET TIME_ZONE = '-05:00'; Query OK, 0 rows affected obclient> SELECT CURRENT_TIMESTAMP(2) FROM DUAL; +---------------------------------+ | CURRENT_TIMESTAMP(2) | +---------------------------------+ | 17-NOV-21 04.22.51.13 AM -05:00 | +---------------------------------+ 1 row in setSet the current session time zone to GMT+8, return the current session time and session time zone information, and adjust the precision of the seconds to
2.obclient> ALTER SESSION SET TIME_ZONE = '+08:00'; Query OK, 0 rows affected obclient> SELECT CURRENT_TIMESTAMP(2) FROM DUAL; +---------------------------------+ | CURRENT_TIMESTAMP(2) | +---------------------------------+ | 17-NOV-21 05.23.01.92 PM +08:00 | +---------------------------------+ 1 row in set
