[Mono-bugs] [Bug 479061] New: DateTime.TryParse fails for ISO8601 format with IFormatProvider and flags specified

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Feb 24 09:29:33 EST 2009


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

User joe at mistachkin.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=479061#c1

           Summary: DateTime.TryParse fails for ISO8601 format with
                    IFormatProvider and flags specified
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.2.x
          Platform: x86
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: CORLIB
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: joe at mistachkin.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20)
Gecko/20081217 Firefox/2.0.0.20 (.NET CLR 3.5.30729)

using System;
using System.Globalization;

CultureInfo cultureInfo = CultureInfo.GetCultureInfo("en-US");

DateTime dateTime1;

if (DateTime.TryParse("2009.02.24T13:57:07.000", cultureInfo.DateTimeFormat,
DateTimeStyles.None, out dateTime1))
    Console.WriteLine("success {0}", dateTime1);
else
    Console.WriteLine("failure #1");

DateTime dateTime2;

if (DateTime.TryParse("2009.02.24T13:57:07.000 -0800",
cultureInfo.DateTimeFormat, DateTimeStyles.None, out dateTime2))
    Console.WriteLine("success {0}", dateTime2);
else
    Console.WriteLine("failure #2");


Reproducible: Always

Steps to Reproduce:
Run the code listed above.
Actual Results:  
failure #1
failure #2

Expected Results:  
success 2/24/2009 1:57:07 PM
success 2/24/2009 1:57:07 PM

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