Re: Assigning a timestamp without timezone to a timestamp

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: chrisj <chrisj(dot)wood(at)sympatico(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Assigning a timestamp without timezone to a timestamp
Date: 2006-10-03 14:51:34
Message-ID: 20061003145134.GA3399@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Oct 03, 2006 at 07:26:52AM -0700, chrisj wrote:
> location, but they are the directive to all store locations saying: "In the
> context of the timezone your store is located in, these are the hours you
> should be open.

Ah. Well, then, right, it _does_ have to be timezone free. That's
actually the only case I'd use that. Sorry, I'm dim, and didn't
understand properly what you were doing. (I read the "relative to
the store's own time zone" to refer to the corporate office. No, I
don't know why, either. Told you I'm dim.)

Anyway, here's something that worked for me (expanding this into your
case ought not to be too tricky):

testing=# SELECT * from storetz ;
id | timezone
----+----------
1 | -03
(1 row)

testing=# SELECT a.timestamp::timestamptz from (SELECT '2006-10-03
09:00'||"timezone" as timestamp from storetz where id = 1) as a;
timestamp
------------------------
2006-10-03 12:00:00+00
(1 row)

A
--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
When my information changes, I alter my conclusions. What do you do sir?
--attr. John Maynard Keynes

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message paallen 2006-10-03 14:55:55 Update 3 columns w/ 1 function calc 3 values?
Previous Message chrisj 2006-10-03 14:26:52 Re: Assigning a timestamp without timezone to a timestamp