1. I fixed some issues surrounding DST switches and added much more
thorough unit tests for testing what happens when a DST switch occurs.
2. I also added utcOffsetAt to TimeZone and utcOffset to SysTime to give
the total UTC offset at a specific time.
3. And last but not least, since the unit tests seem to no longer cause
dmd to run out of memory on Windows, std.datetime's unit tests have been
enabled on Windows.
This also fixes Bug# 6181: http://d.puremagic.com/issues/show_bug.cgi?id=6181
Remove use of deprecated typedef from phobos. This mostly consists of changing typedef to alias, and disabling unittests that require typedef. One change to std.registry is needed to work around a bug in typedef (6571).
Before, it wasn't possible to have negative FracSecs (which worked great
for SysTime but not so well for Duration). Now, in order to fix
Duration, negative FracSecs are possible, so SysTime has been changed to
throw if it's given a negative FracSec.
endOfMonthDay is too close to endOfMonth, and std.date had daysInMonth
(which amounts to the same thing), so I'm renaming endOfMonthDay to
daysInMonth. So, endOfMonthDay is now scheduled for deprecation. I also
adjusted the various deprecation messages related to std.datetime so
that they included the month when the items in question would be deprecated.
http://d.puremagic.com/issues/show_bug.cgi?id=5781
Unfortunately, _all_ of the unit tests are now disabled on Windows
(instead of just most of them). Issue #5454 seems to be worse at present.
Hopefully Don's changes to CTFE will help.
toISOExtendedString is annoyingly long - albeit wonderfully accurate -
and toISOExtString seems accurate enough and enough shorter to be worth
the switch. The old names are scheduled to be deprecated.
putenv actually keeps a pointer to the string that it's passed, which
setTZEnvVar didn't take into account, so putenv risked having an invalid
pointer as soon as a garbage collection cycle was run. This is an
example of a bug that's easier to find in C++. The inderministic nature
of garbage collection makes it much more insidious. But it's the kind of
thing that's really only going to happen when interacting with code that
isn't D code.
http://d.puremagic.com/issues/show_bug.cgi?id=5761
A subtle math error involving leap years caused Dec-30 and Dec-31 of A.D.
leap years and Jan-01 and Jan-02 of B.C. leap years to be off by one day.
The revised tests catch the bug.
They tests that were changed are a bit scattered, because I was trying
to pick the tests that were related to the test failure in SysTime's day
getter property (which is a manifestation of bug# 5761).
There should be no functional changes to the code - only the unit tests.
Also, the lines which have been changed are now mostly within 80
characters, and those that are over are not over by much. Only a portion
of the tests have been updated, but I'm doing it in chunks.
assertThrown, assertNotThrown, and collectExceptionMsg were removed
from std.datetime, since they're in std.exception now, and assertPred
was renamed to _assertPred in case anyone is trying to use the function
which was under review in their own code (since all templates are
currently public even if declared private).
There should be no functional changes to std.datetime. It's just
adjusting which versions of the unit test functions get called.
It will still use daylight if it's there, but since FreeBSD doesn't have
it for some reason (in spite of the fact that the daylight variable is
part of Posix), we can't assume that it's there.
Also, now that tzname is in druntime, it has been removed from
std.datetime.
This should fix bug# 5616.