Skip site navigation (1) Skip section navigation (2)

Re: How do I convert a timestamp with time zone to local time?

From: "Valter Douglas Lisbôa Jr(dot)" <douglas(at)trenix(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How do I convert a timestamp with time zone to local time?
Date: 2008-07-29 18:36:23
Message-ID: 200807291536.23813.douglas@trenix.com.br (view raw or flat)
Thread:
Lists: pgsql-general
On Tuesday 29 July 2008 15:07:46 Rob Richardson wrote:
> Greetings!
>
> What is the best way to convert a time expressed as a timestamp with
> time zone into a timestamp in the local time zone without knowing what
> the local time zone is?
>
> Thank you.
>
> RobR
SELECT extract (epoch from your_time_field) from your_table;
SELECT to_timestamp(your_epoch_field) from your_table;

-- 
Valter Douglas Lisbôa Jr.
Sócio-Diretor
Trenix - IT Solutions
"Nossas Idéias, suas Soluções!"
www.trenix.com.br
contato(at)trenix(dot)com(dot)br
Tel. +55 19 3402.2957
Cel. +55 19 9183.4244

In response to

Responses

pgsql-general by date

Next:From: Alan HodgsonDate: 2008-07-29 18:53:26
Subject: Re: Index creation and maintenance_work_mem
Previous:From: Rob RichardsonDate: 2008-07-29 18:07:46
Subject: How do I convert a timestamp with time zone to local time?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group