How to get current date in PostgreSQL

In this article, we will see how to get current date in PostgreSQL. We can get current date in PostgreSQL by running the command current_date. Which gives output as YYYY-MM-DD(Year-month-day of month).

If we want to get date with time, we have to use now() function and if we want to see timezone, we use the command show timezone

Examples get current date in PostgreSQL:

1. Get the current date in PostgreSQL:

select current_date;

How to get current date in PostgreSQL

2. Get the current date with time.

select now();

3. Find the timezone in PostgreSQL by using any of two methods:

select current_setting('TIMEZONE'); show timezone;

So in this article, we have seen how to get current date, current date with time and time zone information in PostgreSQL.