[Keystone Slip # 22] Some confusion with datetime data type and timezone

From: webmaster(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: [Keystone Slip # 22] Some confusion with datetime data type and timezone
Date: 1999-07-26 17:15:00
Message-ID: 199907261715.NAA19697@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

---------------------------------------------------------------------------
Slip number -----: 22
Problem ---------: Some confusion with datetime data type and timezone
Opened by -------: rcoelho(at)px(dot)com(dot)br on 07/26/99 12:26
Assigned To -----: thomas
---------------------------------------------------------------------------
Summary:
This problem happened when a program show a datetime field in the screen, we don't change it and save(update) it. Each time, it added 2 hours to the field, if timezone ID is present.

If datetime is out of abstime limits (1901-2037) timezone ID disappear.

psql mydb
mydb=> create table dttest(anyfield datetime);
CREATE

mydb=> insert into dttest values ('26/07/1999 12:00:00 EST');
INSERT 178665 1
mydb=> select * from dttest;
anyfield
----------------------------
Mon 26 Jul 14:00:00 1999 EST # Why 14:00:00 ?
(1 row)

mydb=> update dttest set anyfield='26/07/1999 12:00:00 EST';
UPDATE 1
mydb=> select * from dttest;
anyfield
----------------------------
Mon 26 Jul 14:00:00 1999 EST # Why 14:00:00 ?
(1 row)

mydb=> update dttest set anyfield='26/07/1999 12:00:00';
UPDATE 1

mydb=> select * from dttest;
anyfield
----------------------------
Mon 26 Jul 12:00:00 1999 EST # Why EST ?
(1 row)

mydb=> update dttest set anyfield='01/01/1950 12:00:00';
UPDATE 1
mydb=> select * from dttest;
anyfield
----------------------------
Sun 01 Jan 12:00:00 1950 EDT # Why EDT ?
(1 row)

mydb=> update dttest set anyfield='01/01/1900 12:00:00';
UPDATE 1
mydb=> select * from dttest;
anyfield
------------------------
Mon 01 Jan 12:00:00 1900 # Where is timezone ID ?
(1 row)

---------------------------------------------------------------------------
History:
07/26/99 13:14 by scrappy:
Dependency changed to 0 from
Current tech changed to thomas from
Status changed to O from U
Contact changed to from ANONYMOUS
Scheduled Close Date changed to 0 from
Scheduled Open Date changed to 0 from
Public setting changed to 1 from 0
Policy changed to 0

---------------------------------------------------------------------------

Full information on this slip is available at:
http://www.postgresql.org/bugs/visitor.php3?sid=22&v_func=zoom

---------------------------------------------------------------------------
This message was generated automatically by Keystone at http://www.postgresql.org

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 1999-07-26 19:49:17 Re: [BUGS] [Keystone Slip # 14] Building pristine source on RedHat Alpha 6.0
Previous Message webmaster 1999-07-26 16:47:51 [Keystone Slip # 18] DROP USER causes core dump if user created a database