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.”

  1. Get the current timestamp:
SELECT CURRENT_TIMESTAMP;
  1. Get the current date:
SELECT CURRENT_DATE;

These functions will return the local time or date of the current database server.

bannerAds