Reputation: 6273
We have used date.ToString ("D")
for formatting the date. But when we globalizat the application to other languages we encounter problems. We expect the day of the week to appear when we use the long date format, but it's not lake so for all languages. According http://www.basicdatepicker.com/samples/cultureinfo.aspx, it is far from all language that print out day a week for the long date format. How should we do to format the date?
Upvotes: 0
Views: 286
Reputation: 6527
If you need an explicit format, specify it like so;
DateTime date = DateTime.Now;
string s = date.ToString("dddd, dd MMMM yyyy");
According to the MSDN doco, the "D" format specifier is affected by the Calendar, which is Culture specific.
You shouldn't make assumptions about string formatting or Date display in particular, when internationalising.
Upvotes: 2