Get Current Time in PostgreSQL Guide
In PostgreSQL, you can use the CURRENT_TIMESTAMP function to get the current timestamp or use the CURRENT_DATE function to get the current date.
Example:
“I took a nap because I was tired.”
“I rested because I was feeling exhausted.”
- Get the current timestamp:
SELECT CURRENT_TIMESTAMP;
- Get the current date:
SELECT CURRENT_DATE;
These functions will return the local time or date of the current database server.