Using the Upper Sorbian culture (hsb) a DateTime object converted to a string uses the format "d. M. yyyy H.mm.ss 'hodź.'". ToString("G") for example returns "31. 12. 2011 5.06.07 hodź." for the 31. of December 2011, 05:06:07 AM.
Problem is though that trying to convert such a string back to a DateTime does not result true. Even simpler strings like "1. 1. 2011" or "1.1.2011" lead to no success. And just in case someone suggests to pass the culture when converting/persing: I did that of course.
Trying to parse "1.2.3" results in the current date with the time 01:02:03.
I consider that a bug. Or does someone know what could be wrong?
I am using .NET 4.5 RTM on a Windows 8 RTM machine.
Sample:
DateTime date = DateTime.Now;
CultureInfo culture = new CultureInfo("hsb");
string dateString = date.ToString("G", culture);
DateTime convertedDate;
bool dateOkay = DateTime.TryParse(dateString, culture,
DateTimeStyles.AllowInnerWhite, out convertedDate);
Console.WriteLine(dateOkay);
// This results false although the date string was read by
// ToString("G") (i.e. '20. 9. 2012 12.28.10 hodź.') and should be okay
dateString = "1. 1. 2000";
dateOkay = DateTime.TryParse(dateString, culture,
DateTimeStyles.AllowInnerWhite, out convertedDate);
Console.WriteLine(dateOkay);
// This results in false although the date string should be okay
dateString = "1.1.2000";
dateOkay = DateTime.TryParse(dateString, culture,
DateTimeStyles.AllowInnerWhite, out convertedDate);
Console.WriteLine(dateOkay);
// This results also in false
dateString = "1.2.3";
dateOkay = DateTime.TryParse(dateString, culture,
DateTimeStyles.AllowInnerWhite, out convertedDate);
Console.WriteLine(dateOkay + ": " + convertedDate);
// This results strangely in true. The converted date is the current date
// with time 01:02:03.