Monthly Archives: December 2009

Date intervals in PostgreSQL

Recently I had to use PostgreSQL date functions. PostgreSQL manual states that it is possible to add an interval to a date using:

select date '2001-09-28' + interval '1 hour'

It doesn’t state that interval can be more complex, like this:

select date '2001-09-28' + interval '5 day 13 hour 11 minute 5 second'