pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Bob Smith <bsmith@h-e.com>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Problem with intervals
Date: Tue, 2 Dec 2003 08:56:05 +0000
Message-ID: <200312020856.05469.dev@archonet.com> (raw)
In-Reply-To: <AFC6FD04-2485-11D8-A180-0003933DD370@h-e.com>
References: <AFC6FD04-2485-11D8-A180-0003933DD370@h-e.com>

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



view thread (5+ messages)  latest in thread

Message-ID: <200312020856.05469.dev@archonet.com>
Permalink:  ../200312020856.05469.dev@archonet.com/
Also on:    postgresql.org/message-id/200312020856.05469.dev@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, bsmith@h-e.com
  Subject: Re: Problem with intervals
  In-Reply-To: <200312020856.05469.dev@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox