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

From: Bryce Nesbitt <bryce1(at)obviously(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: extract or date_part on an interval? How many e
Date: 2008-01-28 04:51:32
Message-ID: 479D5F54.3040107@obviously.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sigh. Ok, I settled on:<br>
<blockquote><tt>select '1987-01-29'::timestamp + interval '21 years'
&gt; now();</tt><br>
</blockquote>
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.<br>
<br>
<br>
Tom Lane wrote:<br>
<blockquote cite="mid:16843(dot)1201489840(at)sss(dot)pgh(dot)pa(dot)us" type="cite">
<pre wrap="">There is nothing simple about datetime calculations, ever :-(
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="100">--
----
Visit <a class="moz-txt-link-freetext" href="http://www.not-so-obviously.com/">http://www.not-so-obviously.com/</a>
</pre>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 871 bytes

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Glaesemann 2008-01-28 05:19:04 Re: extract or date_part on an interval? How many e
Previous Message Tom Lane 2008-01-28 03:10:40 Re: extract or date_part on an interval? How many e