Previously, it formatted the time zone the same as toISOExtString and
put a colon between the hours and minutes - which is correct for the ISO
extended format, but not the non-extended format. Now, it formats it
correctly per the ISO 9601 standard.
fromISOString temporarily accepts both the extended and non-extended
formats to avoid breaking any programs that have been writing out ISO
strings to read back in later, but eventually, we'll make it so that it
only accepts the non-extended format like it's supposed to.
It's proven to be a maintenance problem to maintain the time zone
conversions between the IANA TZ database names and the Windows time zone
names in std.datetime. So, rather than compiling them in, this provides
a way to get them at runtime (which will also make it so in the future,
older releases can work properly on up-to-date Windows boxes, which is
not the case currently with regards to time zone conversions). The
current conversion functions can be deprecated after parseTZConversions
has been out for a release (so that it's possible for users to compile
their code for two releases in a row without getting deprecation
messages).
GetTimeZoneInformation is a Windows API function, and thus will never
throw a D exception. Presumably, at the time this code was written,
it was not marked as nothrow. However, instead of fixing the function's
signature, the code contained try/catch blocks with messages such as
assert(0, "The impossible happened. GetTimeZoneInformation() threw.");
Replace following names:
std.typetuple -> std.meta
TypeTuple -> AliasSeq
ParameterTypeTuple -> Parameters
FieldTypeTuple -> Fields
std.traits requires more work than search/replace and is left unchanged.
This moves all of the private, helper templates for isTimePoint into
isTimePoint (which reduces code) and cleans up their implementation a
bit. The tests have also been improved to actually check types which are
supposed to be false with isTimePoint and the implementation adjusted
accordingly (previously, they failed to compile with isTimePoint rather
than resulting in false).
The checks for TickDuration have been removed in the process, since
we're getting rid of it. No code will break from that, since all it
means is that a type which passes isTimePoint no longer needs to work
with TickDuration. If it does work with TickDuration (as the time point
types in std.datetime will until it's been fully removed), then it will
just continue to work as it has.
This commit also improves the documentation, which was woefully vague.