pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to convert 3 colums to timestamp with timezone
2+ messages / 2 participants
[nested] [flat]

* How to convert 3 colums to timestamp with timezone
@ 2004-10-03 20:50 Jens Arnfelt <jens.arnfelt@cuatro.dk>
  2004-10-03 23:42 ` Re: How to convert 3 colums to timestamp with timezone Bruno Wolff III <bruno@wolff.to>
  0 siblings, 1 reply; 2+ messages in thread

From: Jens Arnfelt @ 2004-10-03 20:50 UTC (permalink / raw)
  To: pgsql-sql

Hi There!

Hope this is an easy one :-D

How do I convert 3 individuel colums with type "date", "time" and
"integer" to at timestamp with timexone?

eg.   tabel
cStartUnixtime    cStartTime    cStartZone
09-24-2004    10:27:12    -2

This I have to present as an timestamp with timezone.

Thanks in advance
Jens Arnfelt





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How to convert 3 colums to timestamp with timezone
  2004-10-03 20:50 How to convert 3 colums to timestamp with timezone Jens Arnfelt <jens.arnfelt@cuatro.dk>
@ 2004-10-03 23:42 ` Bruno Wolff III <bruno@wolff.to>
  0 siblings, 0 replies; 2+ messages in thread

From: Bruno Wolff III @ 2004-10-03 23:42 UTC (permalink / raw)
  To: Jens Arnfelt <jens.arnfelt@cuatro.dk>; +Cc: pgsql-sql

On Sun, Oct 03, 2004 at 22:50:13 +0200,
  Jens Arnfelt <jens.arnfelt@cuatro.dk> wrote:
> Hi There!
> 
> Hope this is an easy one :-D
> 
> How do I convert 3 individuel colums with type "date", "time" and
> "integer" to at timestamp with timexone?
> 
> eg.   tabel
> cStartUnixtime    cStartTime    cStartZone
> 09-24-2004    10:27:12    -2
> 
> This I have to present as an timestamp with timezone.

You can add the date and time to get a timestamp and then use AT TIME ZONE
with the second argument being the integer times an interval of 1 hour.
Sort of like the following:
bruno=> select ('2004-9-24'::date + '10:27:12'::time) at time zone (-2 * '1 hour'::interval);
        timezone
------------------------
 2004-09-24 07:27:12-05
(1 row)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-10-03 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-10-03 20:50 How to convert 3 colums to timestamp with timezone Jens Arnfelt <jens.arnfelt@cuatro.dk>
2004-10-03 23:42 ` Bruno Wolff III <bruno@wolff.to>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox