Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9SA64P81518 for ; Sun, 28 Oct 2001 05:06:04 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f9S9bYb88555 for pgsql-admin@postgresql.org; Sun, 28 Oct 2001 04:37:34 -0500 (EST) (envelope-from news) From: "Emmanuel Guyot" X-Newsgroups: comp.databases.postgresql.admin Subject: Date with timezone format Date: Sun, 28 Oct 2001 10:36:56 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 60 Message-ID: <9rgjkt$2mf8$1@news.tht.net> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-admin@postgresql.org X-Archive-Number: 200110/236 X-Sequence-Number: 2480 I've notice the following behaviour, and would like some comments about the way to interpret it. I have the following table : Table "pointage" Attribute | Type | Modifier -----------------+--------------------------+------------------------ cd_collab | numeric(3,0) | not null dt_debut | timestamp with time zone | not null dt_fin | timestamp with time zone | cd_typ_pointage | numeric(2,0) | not null comm | text | dt_creat | timestamp with time zone | not null dt_modif | timestamp with time zone | not null default now() Index: pk_pointage and the following configuration : NOTICE: DateStyle is SQL with European conventions NOTICE: Time zone is unknown When I use (in psql) : insert into POINTAGE (CD_COLLAB,DT_DEBUT,CD_TYP_POINTAGE,DT_CREAT,DT_MODIF) values ( 1,'28/10/2001 09:26 GMT+01:00',1,'28/10/2001 09:26:16GMT+01:00','28/10/2001 09:26:16 GMT+01:00'); or insert into POINTAGE (CD_COLLAB,DT_DEBUT,CD_TYP_POINTAGE,DT_CREAT,DT_MODIF) values ( 1,'28/10/2001 09:26 GMT+01:00',1,'28/10/2001 09:26:16GMT+01:00','28/10/2001 09:26:16 GMT+01:00'); a select then returns : cd_collab | dt_debut | dt_fin | cd_typ_pointage | comm | dt_creat | dt_modif -----------+----------------------------+--------+-----------------+------+- ---------------------------+---------------------------- 1 | 28/10/2001 10:26:00.00 GMT | | 1 | | 28/10/2001 10:26:16.00 GMT | 28/10/2001 10:26:16.00 GMT but when I use : insert into POINTAGE (CD_COLLAB,DT_DEBUT,CD_TYP_POINTAGE,DT_CREAT,DT_MODIF) values ( 1,'28/10/2001 09:26+01:00',1,'28/10/2001 09:26:16+01:00','28/10/2001 09:26:16+01:00'); a select returns the following results which is right : cd_collab | dt_debut | dt_fin | cd_typ_pointage | comm | dt_creat | dt_modif -----------+----------------------------+--------+-----------------+------+- ---------------------------+---------------------------- 1 | 28/10/2001 08:26:00.00 GMT | | 1 | | 28/1 0/2001 08:26:16.00 GMT | 28/10/2001 08:26:16.00 GMT So it seems that the former syntax is not right and is interpreted as 9:26 with GMT TimeZone, One hour is then added to the date. Is this right ?? If it is, why, with SQL datestyle, is it a bad syntax ? Emmanuel Guyot