Re: [HACKERS] ISO dates with European Format

From: Theo Kramer <theo(at)flame(dot)co(dot)za>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] ISO dates with European Format
Date: 1999-09-14 14:03:17
Message-ID: 37DE55A5.92E273DD@flame.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 1999-09-14 14:16:46 Re: [HACKERS] serial type
Previous Message Tom Lane 1999-09-14 13:53:52 Re: [HACKERS] Re: HISTORY for 6.5.2