In this PostgreSQL post explains how to use the PostgreSQL localtime function with syntax and examples.
The PostgreSQL localtime function returns the current time.
The syntax for the localtime function in PostgreSQL is:
localtime( [ precision ] )
Optional. The number of digits to round the fractional seconds to.
The localtime function can be used in the following versions of PostgreSQL:
Let's look at some PostgreSQL localtime function examples and explore how to use the localtime function in PostgreSQL.
For example:
postgres=# SELECT localtime;
time
-----------------
20:18:08.586881
(1 row)
postgres=# SELECT localtime(1);
time
------------
20:18:08.6
(1 row)
postgres=# SELECT localtime(2);
time
-------------
20:18:08.59
(1 row)
postgres=# SELECT localtime(3);
time
--------------
20:18:08.587
(1 row)