A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/postgresql-current_date-function/ below:

PostgreSQL - CURRENT_DATE Function - GeeksforGeeks

PostgreSQL - CURRENT_DATE Function

Last Updated : 15 Jul, 2025

The PostgreSQL CURRENT_DATE function is used to retrieve the current date. It’s a simple and effective way to ensure your database operations are using the correct date, particularly for applications that need timestamp records.

Let us better understand the CURRENT_DATE Function in PostgreSQL from this article.

Syntax
CURRENT_DATE

Return value:

The 'CURRENT_DATE' function returns a 'DATE' value that represents the current date.

PostgreSQL CURRENT_DATE Function Examples

Let us take a look at some of the examples of the CURRENT_DATE Function in PostgreSQL to better understand the concept.

Example 1: Retrieve the Current Date

The following statement shows how to use the 'CURRENT_DATE' function to get the current date:

SELECT CURRENT_DATE;

Output:

Example 2: Using CURRENT_DATE as a Default Value

The CURRENT_DATE function can be used as a default value of a column. So create a table named 'delivery' for demonstration:

PostgreSQL
CREATE TABLE delivery(
    delivery_id serial PRIMARY KEY,
    product varchar(255) NOT NULL,
    delivery_date DATE DEFAULT CURRENT_DATE
);
INSERT INTO delivery(product)
VALUES('Data Structure And Algorithm Edition 1');
SELECT * FROM delivery;

Output:

Important Points About PostgreSQL CURRENT_DATE Function


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4