Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0A41F475C85 for ; Wed, 20 Nov 2002 05:38:00 -0500 (EST) Received: from egwn.net (ns2.egwn.net [193.172.5.4]) by postgresql.org (Postfix) with ESMTP id 1B198475A71 for ; Wed, 20 Nov 2002 05:37:58 -0500 (EST) Received: from fibers.upc.es (gw01.es3.egwn.net [212.9.66.13]) (authenticated) by egwn.net (8.11.6/8.11.6/EGWN) with ESMTP id gAKAbXV28193; Wed, 20 Nov 2002 11:37:33 +0100 Message-ID: <3DDB65ED.70101@fibers.upc.es> Date: Wed, 20 Nov 2002 11:37:33 +0100 From: Thrasher User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.1b) Gecko/20020721 X-Accept-Language: es, es-es, en-us MIME-Version: 1.0 To: Richard Huxton Cc: pgsql-sql@postgresql.org Subject: Re: Date trunc in UTC References: <3DDB5991.9060706@fibers.upc.es> <200211201024.17210.dev@archonet.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-MailScanner: Found to be clean X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/304 X-Sequence-Number: 10446 No I cannot use SET TIME ZONE. SET TIME ZONE will be set by any client backend. But what I want to get is that DATE_TRUNC('month', ) = DATE_TRUNC('month', ). Richard Huxton wrote: > 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. >