Re: Date manipulation

From: Hadley Willan <hadley(dot)willan(at)deeperdesign(dot)co(dot)nz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, PGSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Date manipulation
Date: 2004-04-19 05:42:21
Message-ID: 1082353340.1202.1.camel@io.sol.deeper.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes, I'm not worried about an exact DST. The date items are stored with
Timestamp Timezone.

Thanks to everybody for your technical tips and help.

Hadley

On Mon, 2004-04-19 at 16:42, Tom Lane wrote:

> Bruno Wolff III <bruno(at)wolff(dot)to> writes:
> > Hadley Willan <hadley(dot)willan(at)deeperdesign(dot)co(dot)nz> wrote:
> >> dateRange = ''now''::date - ( 7 * '1 week'::interval );
>
> > If you actually are using a date you don't have to use an interval as
> > the number subtracted will be in days. So you could just use
> > current_date - (7 * 7);
>
> Good point --- in fact, that's probably exactly what Hadley wants,
> because "date - integer" will yield a date and not a timestamp. The
> form involving interval will do odd things when crossing a DST
> transition.
>
> regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Klint Gore 2004-04-19 06:35:24 plan-reading extensive tutorial?
Previous Message Tom Lane 2004-04-19 04:42:58 Re: Date manipulation