Re: Timestamp to time_t

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Timestamp to time_t
Date: 2009-09-15 15:50:07
Message-ID: 13023.1253029807@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Fetter <david(at)fetter(dot)org> writes:
> On Tue, Sep 15, 2009 at 11:02:52AM -0400, Tom Lane wrote:
>> EXTRACT()?

> I see that EXTRACT() can take a time zone as input, but I don't see
> anywhere that could distinguish among the following inputs, once
> stored, as they have identical representations in UTC:

See TIMEZONE_HOUR, TIMEZONE_MINUTE field specifications, in particular

b) Otherwise, let TZ be the interval value of the implicit
or explicit time zone associated with the <datetime value
expression>. If <extract field> is TIMEZONE_HOUR, then the
result is calculated as

EXTRACT (HOUR FROM TZ)

Otherwise, the result is calculated as

EXTRACT (MINUTE FROM TZ)

I haven't tracked down whether the phrase "implicit or explicit time
zone" is hiding any interesting weasel words, but it sure *looks* like
you are supposed to be able to pull out the TZ offset.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Boszormenyi Zoltan 2009-09-15 16:00:30 Can the PostgreSQL weekly news be retrospectively edited?
Previous Message Devrim GÜNDÜZ 2009-09-15 15:45:26 Re: PGCluster-II Progress