Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 4E967475D01 for ; Wed, 20 Nov 2002 05:30:04 -0500 (EST) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by postgresql.org (Postfix) with ESMTP id 84866475C85 for ; Wed, 20 Nov 2002 05:30:02 -0500 (EST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 18ES7P-0007Zv-0U; Wed, 20 Nov 2002 10:30:03 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 6A49F16517; Wed, 20 Nov 2002 10:24:30 +0000 (GMT) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id C02F615902; Wed, 20 Nov 2002 10:24:29 +0000 (GMT) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: Thrasher , pgsql-sql@postgresql.org Subject: Re: Date trunc in UTC Date: Wed, 20 Nov 2002 10:24:17 +0000 User-Agent: KMail/1.4.3 References: <3DDB5991.9060706@fibers.upc.es> In-Reply-To: <3DDB5991.9060706@fibers.upc.es> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211201024.17210.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/303 X-Sequence-Number: 10445 On Wednesday 20 Nov 2002 9:44 am, Thrasher wrote: > Hi > > I do not know if it's an error, but in this query > > =3D# 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= =20 types for details. --=20 Richard Huxton