Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DDF2A474E61 for ; Wed, 20 Nov 2002 08:15:00 -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 0DF69474E44 for ; Wed, 20 Nov 2002 08:15:00 -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 18EUh4-0000CE-0U; Wed, 20 Nov 2002 13:15:02 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id D092A16719; Wed, 20 Nov 2002 13:06:59 +0000 (GMT) Received: from client.archonet.com (client.archonet.com [192.168.1.16]) by mainbox.archonet.com (Postfix) with ESMTP id 43EA316703; Wed, 20 Nov 2002 13:06:59 +0000 (GMT) Content-Type: text/plain; charset="iso-8859-1" From: Richard Huxton Organization: Archonet Ltd To: Thrasher Subject: Re: Date trunc in UTC Date: Wed, 20 Nov 2002 13:06:47 +0000 User-Agent: KMail/1.4.3 Cc: pgsql-sql@postgresql.org References: <3DDB5991.9060706@fibers.upc.es> <200211201024.17210.dev@archonet.com> <3DDB65ED.70101@fibers.upc.es> In-Reply-To: <3DDB65ED.70101@fibers.upc.es> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211201306.47345.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/306 X-Sequence-Number: 10448 On Wednesday 20 Nov 2002 10:37 am, Thrasher wrote: > 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', ) =3D DATE_TRUNC('month', > ). Sorry, I've obviously misunderstood. Are you just looking to discard the=20 timezone so they look the same? select date_trunc('month', CAST(CURRENT_TIMESTAMP AS timestamp without time= =20 zone)); date_trunc --------------------- 2002-11-01 00:00:00 I'd have thought that would give you some problems around local/utc midnigh= t=20 on the first of the month. Or is it that you want to know what time it was in UTC zone at the start of= =20 the month local time? If I'm still being a bit slow (quite likely) can you explain what you're us= ing=20 this for? > >>=3D# select date_trunc ('month', now ()); > >> date_trunc > >>------------------------ > >> 2002-11-01 00:00:00+01 > >>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 ? --=20 Richard Huxton