[Mono-bugs] [Bug 592221] New: DataTime has wrong size/format

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Mar 30 06:50:42 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=592221

http://bugzilla.novell.com/show_bug.cgi?id=592221#c0


           Summary: DataTime has wrong size/format
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: goldywhite at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1036 Safari/532.5

sizeof(DateTime) is 16 bytes but must be 8 bytes. So any transfers DateTime
from Mono to .NET or vice versa causing lost of data.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.



this is mono format:
public struct DateTime : IFormattable, IConvertible, IComparable,
IComparable<DateTime>, IEquatable <DateTime>
{
    private TimeSpan ticks;
    DateTimeKind kind;
...
}


this is .NET format:
// The data is stored as an unsigned 64-bit integeter
//   Bits 01-62: The value of 100-nanosecond ticks where 0 represents 1/1/0001
12:00am, up until the value
//               12/31/9999 23:59:59.9999999
//   Bits 63-64: A four-state value that describes the DateTimeKind value of
the date time, with a 2nd
//               value for the rare case where the date time is local, but is
in an overlapped daylight
//               savings time hour and it is in daylight savings time. This
allows distinction of these
//               otherwise ambiguous local times and prevents data loss when
round tripping from Local to
//               UTC time.
private UInt64 dateData;

-- 
Configure bugmail: http://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