std.date proposal

Fredrik Olsson peylow at gmail.com
Thu Mar 30 08:39:42 PST 2006


Lucas Goss skrev:
> Fredrik Olsson wrote:
> 
>> John C skrev:
>>
>>> 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.
> 
> 
> I believe you said this earlier:
> 
>  > I intend to do the bare bones, a solid foundation to build on top,
>  > and to be easy to do small stuff. Intervals, timezones, and more
>  > advanced stuff should be done with wrappers on top.
> 
> To me a good "bare bones" base would be the ISO8601 (even though I'm in 
> the US), allowing small stuff on top, like the SQL99 stuff. I think a 
> lot of libraries try to do to much.

You have used my own words against me well.

I am thinking of rewriting date.d to only allow for properly formatted 
dates, times and durations according to ISO8601. And then let 
dateparse.d, be an entity of it's own allowing for more "complex" 
parsing, and formatting.

Is that a sound idea?

// Fredrik



More information about the Digitalmars-d-announce mailing list