[Mono-bugs] [Bug 381103] New: DateTime "Kind" property defaults to Local ( different than .Net)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Apr 17 18:16:38 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=381103


           Summary: DateTime "Kind" property defaults to Local (different
                    than .Net)
           Product: Mono: Class Libraries
           Version: 1.9.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: derekd at omni-ts.com
         QAContact: mono-bugs at lists.ximian.com
                CC: stephane at omni-ts.com
          Found By: ---


Created an attachment (id=208774)
 --> (https://bugzilla.novell.com/attachment.cgi?id=208774)
DateTime issue

Tested on 1.9.0 & 1.9.1p2 and on Win and Linux.

When a time string is given without an indication of Local or Utc, .Net will
default to "unspecified", Mono defaults to "Local". This affects various
operations that use the resulting DateTime object as demonstrated in the
attached program.

Step to reproduce:
1. Console.WriteLine(DateTime.Parse("2008-04-15").ToLocalTime());



The attached program gives more examples, like below:


Example in .net
Input date: 2008-04-15T14:00:00
DateTime.Parse(2008-04-15T14:00:00):

kind:   Unspecified
local:  2008-04-15T08:00:00
utc:    2008-04-15T20:00:00


In Mono:
Input date: 2008-04-15T14:00:00
DateTime.Parse(2008-04-15T14:00:00):

kind:   Local
local:  2008-04-15T14:00:00
utc:    2008-04-15T20:00:00


-- 
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