Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: extract or date_part on an interval? How many e



Sigh. Ok, I settled on:
select '1987-01-29'::timestamp + interval '21 years' > now();
Which is closer to what I wanted anyway (this was all about determining who was under 21 years old).  This at least should be robust over leap years.


Tom Lane wrote:
There is nothing simple about datetime calculations, ever :-(
  

-- 
----
Visit http://www.not-so-obviously.com/


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group