Re: [HACKERS] ISO dates with European Format

Поиск
Список
Период
Сортировка
От Theo Kramer
Тема Re: [HACKERS] ISO dates with European Format
Дата
Msg-id 37DE55A5.92E273DD@flame.co.za
обсуждение исходный текст
Ответ на ISO dates with European Format  (Theo Kramer <theo@flame.co.za>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Re: HISTORY for 6.5.2
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: [HACKERS] serial type