Re: [HACKERS] ISO dates with European Format - Mailing list pgsql-hackers

From Theo Kramer
Subject Re: [HACKERS] ISO dates with European Format
Date
Msg-id 37DE55A5.92E273DD@flame.co.za
Whole thread Raw
In response to ISO dates with European Format  (Theo Kramer <theo@flame.co.za>)
List pgsql-hackers
Thomas Lockhart wrote:
> 
> > I have the requirement for ISO dates with European format and would
> > like to change backend/utils/adt/dt.c:EncodeDateTime() and EncodeDateOnly()
> > to effect this if this is a general requirement.
> 
> What is "ISO dates with European format"? Is it a combination of ISO
> date output with European-style input (which I think can be done
> already), or something else? afaik ISO-8601 is specific about
> suggested formats, and makes no distinction between European and other
> conventions. Can you give examples? TIA

Sure -
 coza=> set datestyle to 'SQL,European'; SET VARIABLE coza=> select registrationdate from accounts where domain =
'flame.co.za';registrationdate            --------------------------- 02/06/1997 00:00:00.00 SAST (1 row)
 

The above result is correct for dd/mm/yyyy styles
 coza=> set datestyle to 'ISO,European'; SET VARIABLE coza=> select registrationdate from accounts where domain =
'flame.co.za';  registrationdate       ---------------------- 1997-06-02 00:00:00+02 (1 row)
 

Instead of 02-06-1997 00:00:00+02

If ISO is specific regarding formatting of days, month and year then I feel that
the "set datestyle to 'ISO,European'" should give an error. However, I would
personally
prefer it to format the result as "dd-mm-yyyy".

--------
Regards
Theo


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: HISTORY for 6.5.2
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] serial type