Skip to content

LOCALTIME

Return the time of day when the current transaction starts. This value does not change during the course of a transaction and does not reflect the individual start times of statements within a transaction.

LOCALTIME[(6)]

The number 6 (for the fractional seconds part of the time) is optional and does not affect the result. This function always returns a precision of 6. You may see results with fewer than 6 fractional seconds because trailing zeroes are not returned. The return type is TIME.

premdb=# select localtime from sys.const;
     time       
-----------------
 23:03:37.860575
(1 row)

premdb=# select localtime(6) from sys.const;
     time       
-----------------
 23:03:40.257122
(1 row)

Parent topic:Datetime Functions