The Date Format in .NET depends upon the
CurrentCulture
unless a different
FormatProvider
is specified in the method producing the string output of
DateTime
value.
In the following code the first two printed
DateTime
values are governed by the
CurrentCulture
whereas in the third the
FormatProvider
given as an argument to
ToString
method has overridden the
CurrentCulture
format.
DateTime today = DateTime.Now;
Thread.CurrentThread.CurrentCulture =
System.Globalization.CultureInfo.GetCultureInfo("hi-IN");
Console.WriteLine (today);
Thread.CurrentThread.CurrentCulture =
System.Globalization.CultureInfo.GetCultureInfo("en-US");
Console.WriteLine (today.ToString());
Console.WriteLine (today.ToString(System.Globalization.CultureInfo
.GetCultureInfo("hi-IN").DateTimeFormat));
Please try to interpret the above info in the context of your code. I think it may be helpful.