datestyle problems?

From: Geoff Russell <geoff(at)austrics(dot)com(dot)au>
To: PostgreSQL List <pgsql-general(at)postgresql(dot)org>
Subject: datestyle problems?
Date: 2000-09-07 01:22:33
Message-ID: Pine.GSO.4.05.10009071033530.2841-100000@magnum
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Have I missed something, or has some date behaviour
changed in going from 6.5.2 to 7.0.2?

drop table tdate;
create table tdate ( demo date );
set DateStyle to 'European';
insert into tdate (demo) values ('31-12-1999');
set DateStyle to 'US'; select demo as US from tdate;
set DateStyle to 'European'; select demo as European from tdate;
set DateStyle to 'SQL'; select demo as SQL from tdate;
set DateStyle to 'ISO'; select demo as ISO from tdate;
set DateStyle to 'German'; select demo as German from tdate;

Gives (with irrelevant lines deleted):
> us
> ------------
> 1999-12-31
Wrong? should be month day year;
>
> european
> ------------
> 1999-12-31
Wrong? should be day month year;
>
> sql
> ------------
> 31/12/1999
Wrong? should be month day year;
>
> iso
> ------------
> 1999-12-31
Right.
>
> german
> ------------
> 31.12.1999
Right.

Cheers,
Geoff Russell
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
6 Fifth Ave +618-8332-5069 (Home) |
St Morris SA 5068 +618-8207-2029 (Work) | geoff(at)austrics(dot)com(dot)au
Adelaide, AUSTRALIA +618-8364-1543 (Fax-Home) |

Responses

Browse pgsql-general by date

  From Date Subject
Next Message The Hermit Hacker 2000-09-07 01:52:34 Re: That killer 3rd join...
Previous Message Bill Sofko 2000-09-07 00:51:23 Re: That killer 3rd join...