Skip site navigation (1) Skip section navigation (2)

Date calc bug

From: Olivier PRENANT <ohp(at)pyrenet(dot)fr>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Date calc bug
Date: 2000-01-02 14:15:47
Message-ID: Pine.UW2.4.21.0001021513050.11391-100000@server.pyrenet.fr (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Happy new year to you all!!

I've run into this problem 3 days ago:

Script started on Sun Jan  2 14:59:03 2000
~ 14:59:04: psql
Welcome to the POSTGRESQL interactive sql monitor:
  Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.3 on i586-pc-unixware7.0.1, compiled by cc ]

   type \? for help on slash commands
   type \q to quit
   type \g or terminate with semicolon to execute query
 You are currently connected to the database: ohp

ohp=> select '01-12-1999'::datetime + '@ 1 month - 1 sec' as bug;

bug                         
----------------------------
Thu 30 Dec 23:59:59 1999 MET
(1 row)
    ^^
Should be 31!!

ohp=> select '01-01-2000'::datetime + '@ 1 month - 1 sec' as good;

good                        
----------------------------
Mon 31 Jan 23:59:59 2000 MET
(1 row)
Seems OK after Jan 1rst!!

Any idea?

Regards
-- 
Olivier PRENANT         	Tel:	+33-5-61-50-97-00 (Work)
Quartier d'Harraud Turrou           +33-5-61-50-97-01 (Fax)
31190 AUTERIVE                      +33-6-07-63-80-64 (GSM)
FRANCE                      Email: ohp(at)pyrenet(dot)fr
------------------------------------------------------------------------------
Make your life a dream, make your dream a reality. (St Exupery)


Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-01-02 18:02:00
Subject: Re: [BUGS] Date calc bug
Previous:From: Don BaccusDate: 2000-01-02 03:09:38
Subject: Re: [HACKERS] dubious improvement in new psql

pgsql-bugs by date

Next:From: Tom LaneDate: 2000-01-02 18:02:00
Subject: Re: [BUGS] Date calc bug
Previous:From: Robert McbrideDate: 2000-01-01 23:39:28
Subject: what can i do about the 554 hop count/

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group