D-Programming-Language/phobos — pull request #973 by jmdavis (2012-11-25 04:23:02+00:00)
Title: Make SimpleTimeZone (almost) stop using naked numbers for utcOffset

Unfortunately, when I originally created `SimpleTimeZone`, I failed to use `Duration` for the `utcOffset` and instead used a naked `int` which held the number of minutes for the offset. This pull request (mostly) fixes that. Unfortunately, I can't completely fix it at this point without breaking code, because the `utcOffset` property of `SimpleTimeZone` is an `int` rather than a `Duration`. If we could have multiple alias thises for a type, then I'd probably have it return a voldemort type which implicitly converted to both `Duration` and `int`, but that won't work for the moment. I have however changed its internal representation to use a `Duration` and changed over everything else in `SimpleTimeZone` to take or use `Duration`. The only places that it still uses `int` are in the `utcOffset` property and in an overload of the constructor.

Most of the the changes are in the 2nd commit and are for making it so that std.datetime uses the overload of `SimpleTimeZone`'s constructor which takes a `Duration` instead of an `int`, whereas the actual API and functionality changes should all be in the first commit, and those are relatively small.