std.date proposal
Fredrik Olsson
peylow at gmail.com
Tue Mar 28 10:36:43 PST 2006
Stewart Gordon skrev:
> Fredrik Olsson wrote:
>
>> I have created a proposal for a std.date replacement. And announce it
>> here in hopes of some comments and criticism.
>
> <snip>
>
> Preliminary comments:
>
> 1. It's "millennuim" (singular), "millennia" (plural). Two 'n's. Not
> "millenia". And why no CENTURY?
>
Check, corrected. And century added wherever proper. Added Julian day
when I was at it.
> 2. What is UDT?
>
That would be a misspelled UTC, shamefully corrected now.
> 3. I think you should leave out the "3/10/06" format because of the
> inherent ambiguity. And in English, the third month is called March,
> not mars.
>
Spelling corrected, I bet there is more, way more...
"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 :).
Perhaps a mode flag should be added, to prefer YMD, DMY or MDY whenever
an ambiguity exists?
> 4. How does your module deal with time zones?
>
Pretty much as SQL99 does, that is you choose with or without time zone
when time is created. Time zones are parsed, but currently ignored. I
think the best option is to let the user simply choose if dates should
be adjusted to UTC or to local when parsed.
> 5. I've also written an alternative to std.date. Please check it out:
>
I like it, looks neat and clean, and in no way competing I think. On the
contrary I would like yours to grow and complement, as I see it a OOP
Date/Time library on top of mine would be the best solution. Sort of
like how std.stdio should work as the under layer for a more feature
complete module on top.
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.
> http://pr.stewartsplace.org.uk/d/sutil/
>
> Stewart.
>
More information about the Digitalmars-d-announce
mailing list