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