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

User [email protected] 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: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to