Re: ecmascript 5 DATESTYLE

Поиск
Список
Период
Сортировка
От Ben Hockey
Тема Re: ecmascript 5 DATESTYLE
Дата
Msg-id ADC28FE9-B392-4C53-9F6B-E24ED01AC15B@gmail.com
обсуждение исходный текст
Ответ на Re: ecmascript 5 DATESTYLE  (Mike Fowler <mike@mlfowler.com>)
Ответы Re: ecmascript 5 DATESTYLE  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On May 19, 2010, at 4:31 AM, Mike Fowler wrote:

> Pavel Stehule wrote:
>> 2010/5/19 Peter Eisentraut <peter_e@gmx.net>:
>>
>>> On tis, 2010-05-18 at 18:26 -0400, Ben Hockey wrote:
>>>
>>>> ecmascript 5 is the most recent specification for JavaScript and i
>>>> would think that having a DATESTYLE format to simplify
>>>> interoperability with JavaScript applications would be highly
>>>> desirable.
>>>>
>>> Note that we haven't got any other datestyles that are intended to
>>> support interoperability with some language.  It is usually the  
>>> job of
>>> the client driver to convert PostgreSQL data (plural of datum) to  
>>> the
>>> appropriate type and format for the client environment or  
>>> language.  Is
>>> there any reason why JavaScript would be different?
>>>
>
> I wouldn't be keen to see dedicated language specific handling of  
> date/datetime formats. It would lead to an explosion of functions  
> with new languages needing adding as and when their users jumped up  
> and down on us. However a generic format could be very useful and  
> would give the opportunity for people who need a language specific  
> short cut the opportunity to do a CREATE FUNCTION wrapping the  
> generic one with a hard coded format specifier.
>
> Other platforms have generic support for this kind of task, for  
> example SQLServer: http://msdn.microsoft.com/en-us/library/ms187928.aspx 
> . I wouldn't recommend the SQLServer way, I think numeric format  
> specifiers are clumsy. Perhaps a mechanism like Java which is nicely  
> summarized here: http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html

i think that http://unicode.org/reports/tr35/#Date_Format_Patterns is  
very similar to (maybe the same as) the java simple date format but  
the unicode link gives a more complete explanation of exactly how the  
formatters will be interpreted - ie y will represent the full  
representation of the year but yy will represent the 2 digit form of  
the year, etc..  just thought i'd share the reference since it  
provides a powerful way to generically specify date formats and is  
possibly something that many people might already be familiar with.

thanks for looking into adding this feature.  custom formats for  
parsing and formatting of dates would certainly be the better option  
if it can be done securely.

thanks,

ben..


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Unexpected data beyond EOF during heavy writes
Следующее
От: Florian Pflug
Дата:
Сообщение: Re: Row-level Locks & SERIALIZABLE transactions, postgres vs. Oracle