[Mono-bugs] [Bug 673762] New: DateTime.ParseExact doesn't recognize '/' in format string as date separator

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Feb 21 07:33:31 EST 2011


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

https://bugzilla.novell.com/show_bug.cgi?id=673762#c0


           Summary: DateTime.ParseExact doesn't recognize '/' in format
                    string as date separator
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: x86
        OS/Version: openSUSE 11.3
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: Felix.Riemann at sma.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=415275)
 --> (http://bugzilla.novell.com/attachment.cgi?id=415275)
test case

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.13)
Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0E)

When supplying a date format string to DateTime.ParseExact it is possible to
use "/"-chars to designate a general date separator char. These are practically
an alias for the DateSeparator property of the DateTimeFormatInfo instance that
is also passed to ParseExact. This makes it possible to parse "01.01.2011" with
a "dd/MM/yyyy" format string when the given DateSeparator is ".".

This is at least how it works with .NET.

Mono however throws a FormatException thinking the format string is invalid.

Reproducible: Always

Steps to Reproduce:
1. Run the attached test case.
Actual Results:  
Mono throws a FormatException once the format string uses "/" instead of ".".
NET parses the date correctly.

Expected Results:  
Mono should parse the date correctly as does .NET.

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