[Mono-bugs] [Bug 475231] New: DateTime.ParseExact failes on fractions of seconds

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Feb 12 10:52:21 EST 2009


           Summary: DateTime.ParseExact failes on fractions of seconds
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: x86-64
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: kps116 at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

Created an attachment (id=272355)
 --> (https://bugzilla.novell.com/attachment.cgi?id=272355)
test.cs - test program

Description of Problem:

Converting and parsing a DateTime cuts milliseconds.
This seems due to the internal representation in a double.

Steps to reproduce the problem:

1. convert DateTime to string:
                string conv = date.ToString("yyyy-MM-dd HH:mm:ss.FFFFFFF",

2. read string back to DateTime
                dateread = DateTime.ParseExact(conv, "yyyy-MM-dd
HH:mm:ss.FFFFFFF", DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None);

3. compare DateTime or DateTime.Ticks

Actual Results:

  in: 2009-02-15 00:00:00.FFFFFFF is 633702528000000000
read: 2009-02-15 00:00:00.FFFFFFF is 633702528000000000

  in: 2009-02-15 00:00:00.FFFFFFF is 633702528000000001
read: 2009-02-15 00:00:00.FFFFFFF is 633702528000000000

Expected Results:

(output from ms.net)
  in: 2009-02-15 00:00:00 is 633702528000000000
read: 2009-02-15 00:00:00 is 633702528000000000

  in: 2009-02-15 00:00:00.0000001 is 633702528000000001
read: 2009-02-15 00:00:00.0000001 is 633702528000000001

How often does this happen?

every time for certain DateTime's

Additional Information:

see attached test.cs

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list