Re: Date trunc in UTC

From: Richard Huxton <dev(at)archonet(dot)com>
To: Thrasher <thrasher(at)fibers(dot)upc(dot)es>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Date trunc in UTC
Date: 2002-11-20 10:24:17
Message-ID: 200211201024.17210.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wednesday 20 Nov 2002 9:44 am, Thrasher wrote:
> Hi
>
> I do not know if it's an error, but in this query
>
> =# select date_trunc ('month', now ());
> date_trunc
> ------------------------
> 2002-11-01 00:00:00+01
> (1 row)
>
> I've got the truncated date dependant to my timezone.
>
> Instead, I would like to have as a result
>
> 2002-11-01 01:00:00+01
>
> which is correct, but I cannot set the whole server to UTC. Any way to
> get this ?

Perhaps SET TIME ZONE is what you want. See the manual section on date/time
types for details.

--
Richard Huxton

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Thrasher 2002-11-20 10:37:33 Re: Date trunc in UTC
Previous Message Johannes Lochmann 2002-11-20 09:58:06 Re: trying to learn plpqsql... so please forgive..