URL: http://www.postgresql.org/docs/7.4/static/functions-datetime.html#OPERATORS-DATETIME-TABLE

Finally I found it. How to add one year to a date in PostgreSQL


SELECT 
 date('now') + interval '1 year' AS today_in_one_year,
 date '2003-12-13' + interval '1 year' AS my_next_birthday ;

Both return a TIMESTAMP type.

Comments

Peter

UPDATE: It doesn't return a TIMESTAMP type, it's a DATE type (only 4 bytes).

To get a TIMESTAMP you can do this:

SELECT '2003-12-13' + interval '1 year' AS my_next_birthday;

Your email will never ever be published.

Previous:
PayPalSucks.com, can't be good for PayPal February 4, 2004 Web development
Next:
Techie things I want to buy from ebuyer.com February 5, 2004 Wondering
Related by category:
How to find which git SHA it was when you merged in the default branch February 26, 2026 Linux
hylite as an executable October 15, 2025 Linux
Elasticsearch memory usage December 11, 2025 Linux
How to count the number of non-blank lines with Bash September 3, 2025 Linux
Related by keyword:
Adding client-to-server sync to PissueTracker March 20, 2025 React, JavaScript, Bun
Connecting with psycopg2 without a username and password February 24, 2011 Python
How I performance test PostgreSQL locally on macOS December 10, 2018 Web development, PostgreSQL, macOS
When Docker is too slow, use your host January 11, 2018 Web development, Django, Docker, macOS