Bug 5552 – std.datetime.d DosFileTimeToSysTime has a bug

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-02-08T18:49:00Z
Last change time
2011-02-12T06:10:07Z
Assigned to
issues.dlang
Creator
soarowl

Comments

Comment #0 by soarowl — 2011-02-08T18:49:15Z
import std.datetime, std.stdio; void main() { auto time = cast(DosFileTime)0x3E3F8456; writeln(DosFileTimeToSysTime(time)); //output should: 2011-Jan-31 16:34:44 } Compile and run above snipplet, will get an exception. Solution: change std.datetime.d at line 31820 from int month = ((dt >> 21) & 0x0F) - 1; // 1..12 to int month = ((dt >> 21) & 0x0F); // 1..12
Comment #1 by issues.dlang — 2011-02-12T06:10:07Z