-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
Milestone
Description
Description
DateTimeOffset does not correctly parse a valid ISO-8601 datetime string. Wikipedia claims the current ISO-8601 definition prefers a comma as the decimal mark for the lowest time order present:

However, DateTimeOffset is not capable of parsing a datetime string with a comma decimal mark for the lowest time order when that time order is seconds:
static void Main(string[] args)
{
static void Test()
{
var dateString = "2021-04-23T13:04:17,307642270+02:00";
DateTimeOffset date = DateTimeOffset.MinValue;
try
{
date = DateTimeOffset.Parse(dateString);
}
catch (Exception e)
{
Console.WriteLine($"date: {e.Message}");
}
finally
{
Console.WriteLine($"date: {date}");
}
}
Test();
}
Configuration
Code above running on .NET 5.0.202 on Windows 20H2 (OS Build 19042.928).