std.datetime impenetrable
Jonathan M Davis
jmdavisProg at gmx.com
Thu Sep 15 12:43:57 PDT 2011
On Thursday, September 15, 2011 19:30:24 Steve Teale wrote:
> Oh, so it is difficult after all! I thought it was just me.
No. It's hard. The best that you can get by asking Posix functions is the std
and DST abbreviations for the current time zone - and those are non-unique.
You'd have to do some crazy stuff like trying to find the time zone file for the
current time zone on disk (whose location is usually something like
/etc/localtime or /etc/timezone but is not entirely standard) and then compare
it with every other time zone file to figure out which one it is. It's ugly. I
do hope to come up with a reasonable way to do it at some point (you _should_
be able to do it after all), but I haven't yet. It would require a fair bit of
research to figure out what's standard enough to rely on and what isn't. So,
yeah. It's one of the many reasons that dealing with time sucks. Though
hopefully std.datetime manages to make most of it fairly easy and pleasant to
deal with.
> So I am probably going to have to ask. Then the interesting question will be
> which way around will offend fewest people.
>
> I have installed it as ISO, then have to ask US users if they would prefer
> Letter Size, or the other way round then all those Euro and Indian users
> say 'typical American programmer!'.
>
> Thanks for the rundown anyway.
No problem. std.datetime is actually pretty easy to use, but it's large enough
that it can be a bit overwhelming.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list