X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0C1BDD1B45C for ; Tue, 2 Dec 2003 08:56:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 78130-03 for ; Tue, 2 Dec 2003 04:56:11 -0400 (AST) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by svr1.postgresql.org (Postfix) with ESMTP id 13F09D1D302 for ; Tue, 2 Dec 2003 04:56:09 -0400 (AST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 1AR6KH-000LcV-0U; Tue, 02 Dec 2003 08:56:10 +0000 Received: by mainbox.archonet.com (Postfix, from userid 529) id AF22A16C03; Tue, 2 Dec 2003 08:56:07 +0000 (GMT) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 1000A16C00; Tue, 2 Dec 2003 08:56:06 +0000 (GMT) From: Richard Huxton To: Bob Smith , pgsql-sql Subject: Re: Problem with intervals Date: Tue, 2 Dec 2003 08:56:05 +0000 User-Agent: KMail/1.5 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312020856.05469.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/10 X-Sequence-Number: 16176 On Tuesday 02 December 2003 05:09, Bob Smith wrote: > I'm getting an unexpected result using intervals in an expression: > > select ('2003-10-26 0:00:00'::timestamp + '1 day'::interval)::date; > date > ------------ > 2003-10-26 > I assumed '1 day' would always increment the date by 1, but it appears > that '1 day' just means '24 hours', and due to the daylight/standard > time shift, October 26 was 25 hours long this year. > > Is this a Postgres bug, or is this correct SQL behavior? I'm running > Postgres 7.2.2. Expected, because you're acting on a timestamp. When you start looking at time handling across timezones and daylight saving systems across the world it does get a bit complicated. -- Richard Huxton Archonet Ltd