Hey there community,
I have one question why my code is working. :P
Yeah, sounds strange, but I'm just curious...
When I'm starting my application in English I'm setting my current culture info:
CultureInfo cultureInfo;
cultureInfo = new CultureInfo("en-US");
cultureInfo.DateTimeFormat.ShortDatePattern = "MM/dd/yy";
cultureInfo.DateTimeFormat.LongDatePattern = "MM/dd/yyyy";
cultureInfo.DateTimeFormat.ShortTimePattern = "HH:mm";
cultureInfo.DateTimeFormat.LongTimePattern = "HH:mm:ss";
Thread.CurrentThread.CurrentCulture = cultureInfo;
Thread.CurrentThread.CurrentUICulture = cultureInfo
Looking in the MSDN of
DateTime.Parse() [
^], I find the following description:
"Parse a date and time string by using the conventions of the current culture. --> Parse(String) overload"
But the following Parse (with our Austrian date format) works without problems:
DateTime toCompare = DateTime.Parse("01.01.1900 00:00:00");
Can anyone explain why i don't have to use the DateTime.Parse(string, IFormatProvider) overload?
As far as I understand the MSDN, my current .Parse() should not work...
Thanks, Markus