www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5552] New: std.datetime.d DosFileTimeToSysTime has a bug

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5552

           Summary: std.datetime.d DosFileTimeToSysTime has a bug
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: soarowl yeah.net



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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 08 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5552


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jmdavisProg gmx.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 08 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5552


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED



PST ---
Fixed in commit:
https://github.com/D-Programming-Language/phobos/commit/0e69424fa4d471bb2a73e88e778df7f50c762236

Merged into main repository:
https://github.com/D-Programming-Language/phobos/commit/c852cd650cf0aec9bd08b33b297641b28e859737

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 12 2011