PostgreSQL: current_date Function
This PostgreSQL tutorial explains how to use the PostgreSQL current_date function with syntax and examples.
Description
The PostgreSQL current_date function returns the current date.
Syntax
The syntax for the current_date function in PostgreSQL is:
current_date
Parameters or Arguments
There are no parameters or arguments for the current_date function.
Note
- The current_date function will return the current date as a 'YYYY-MM-DD' format.
- Do not put parentheses () after the current_date function.
Applies To
The current_date function can be used in the following versions of PostgreSQL:
- PostgreSQL 9.4, PostgreSQL 9.3, PostgreSQL 9.2, PostgreSQL 9.1, PostgreSQL 9.0, PostgreSQL 8.4
Example
Let's look at some PostgreSQL current_date function examples and explore how to use the current_date function in PostgreSQL.
For example:
postgres=# SELECT current_date; date ------------ 2014-04-24 (1 row) postgres=# SELECT current_date + 1; ?column? ------------ 2014-04-25 (1 row)
Advertisements