PostgreSQL - CURRENT_DATE Function Last Updated : 17 Jul, 2024 Comments Improve Suggest changes Like Article Like Report 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.SyntaxCURRENT_DATEReturn value:The 'CURRENT_DATE' function returns a 'DATE' value that represents the current date.PostgreSQL CURRENT_DATE Function ExamplesLet 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 DateThe 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 ValueThe 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 FunctionThe CURRENT_DATE function returns the date according to the server’s current time zone setting but does not include the time part.CURRENT_DATE is evaluated only once per transaction. This means that if you use CURRENT_DATE multiple times in a single transaction, it will return the same value every time, which can be beneficial for consistency.Unlike NOW() or CURRENT_TIMESTAMP, which return the exact moment including time, CURRENT_DATE is immutable within the context of a single query,CURRENT_DATE can be used as a default value in table definitions, ensuring new rows have the correct date without needing to be explicitly set during insertion. Comment More infoAdvertise with us Next Article PostgreSQL - CURRENT_DATE Function R RajuKumar19 Follow Improve Article Tags : PostgreSQL PostgreSQL-function PostgreSQL-Date-function Similar Reads PostgreSQL - CURRENT_TIME Function The PostgreSQL CURRENT_TIME function returns the current time and the current time zone. This function is handy when you need to work with time-sensitive data in your database applications.Let us better understand the CURRENT_TIME Function in PostgreSQL from this article.SyntaxCURRENT_TIME(precision 2 min read PostgreSQL Date Functions PostgreSQL is widely recognized for its comprehensive support for date and time manipulations, making it an excellent choice for applications requiring precise time management and complex calculations. This article explores the core PostgreSQL date functions, covering how to retrieve the current dat 4 min read PostgreSQL DATE_PART Function Handling dates and times efficiently is essential for data-driven applications, and PostgreSQL provides powerful built-in functions for managing and manipulating time-based data. One such function is the DATE_PART() function, which allows us to extract specific subfields from date and timestamp valu 5 min read PostgreSQL - CURRENT_TIMESTAMP Function PostgreSQL provides the 'CURRENT_TIMESTAMP() function, which returns the current date and time, along with the time zone, at the precise moment the transaction begins. This function is often used for tracking the creation or modification of records in a database.Here, weâll look into the syntax, usa 2 min read DATEADD() Function in PostgreSQL PostgreSQL is a powerful, open-source relational database system known for its strength and wide range of functionalities. DATEADD function in PostgreSQL adds or subtract time intervals from a given date. In this article, we will discuss basic usage, advanced interval types, and practical examples f 6 min read Like