Bug 5761 – std.datetime: Date.this(int day) conversion fails for Dec 30 of leap years

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-03-21T04:59:00Z
Last change time
2011-05-05T01:26:50Z
Assigned to
issues.dlang
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2011-03-21T04:59:29Z
import std.datetime; void main() { assert(SysTime(Date(2008, 12, 30)).day == 30); }
Comment #1 by issues.dlang — 2011-03-23T23:32:08Z
Now, _that_ was a nasty little math bug. Well, I now have a fix, and if you need it, the code can be gotten here: https://github.com/jmdavis/phobos/tree/datetime I'm revamping std.datetime's unit tests at the moment, and I probably won't create a pull request until that's done. Also, with these changes, the unit tests currently fail on Windows due to bug# 5781, so that's going to need to be fixed before a pull request is made. However, the changes are posted in the datetime branch of my github repository if you need them before they actually get merged into Phobos proper.
Comment #2 by dlang-bugzilla — 2011-03-24T13:19:59Z
Thanks, the fix worked :) Feel free to close the issue when the fix is in.
Comment #3 by issues.dlang — 2011-05-05T01:26:50Z