std.date proposal

Fredrik Olsson peylow at treyst.se
Thu Mar 30 01:02:23 PST 2006


John C skrev:
>> "M/D/Y" will stay I think, it is the US way, ambiguous or not, and there 
>> is allot of code/people out there making this assumption. If I could 
>> choose myself we would all go ISO :).
> 
> Who are these people expecting dates to appear in US format, I wonder?
> 
> A date library that has no notion of locales has no business making any 
> region-specific assumptions and should just implement ISO8601. After all, 
> that's what it's for.
> 
> If you must support a common date format, it should be D/M/Y, which is used 
> by the vast majority of countries and accepted internationally. 
> http://en.wikipedia.org/wiki/Calendar_date
> 

Ok, let me argue for my point, and they you argue why not :).

I have chosen the implementation for one single reason; I do as the 
SQL99 standard does. Instead of inventing my own scheme I have chosen a 
scheme I know, and is used by many.

I could dumb it down, and greatly reduced code size, and only allow for 
ISO 8601 formatting, but as I rewrote the PostgreSQL parser 
implementation I deliberately kept the SQL way. Because it is a known 
standard, and allows for some flexibility.

// Fredrik



More information about the Digitalmars-d-announce mailing list