Re: Timezone issue with date_part

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, kenzoid(at)io(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Timezone issue with date_part
Date: 2002-11-02 21:21:44
Message-ID: 200211021321.44211.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Tom,

> (IMHO, the SQL spec is really brain-dead to define timestamp without
> time zone as the default form of timestamp; the variant with time zone
> is much more useful for most applications. It's far too easy to shoot
> yourself in the foot when working with zoneless timestamps --- usually
> in a way that you won't notice until daylight-savings transition time
> comes around, or you roll out the app to users in other time zones.)

It's pretty easy to shoot yourself in the foot with time zones, as well. For
example, most people are thrown off by the daylight-savings-time shift in
date calculations; for example:

select '2002-10-20 00:00:00 PDT'::TIMESTAMPTZ + '2 weeks'::INTERVAL
jwnet-> ;
?column?
------------------------
2002-11-02 23:00:00-08

This sort of behavior can really muck with calendar applications. Of course,
it could be solved with a DAY/WEEK subtype, but I've already advocated for
that.

--

-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2002-11-03 01:20:04 Re: Different size in the DATA directory
Previous Message Ken Kennedy 2002-11-02 20:55:31 Re: Timezone issue with date_part