I wanted to show the date in dd-MMM-yyyy format for Japanese culture in a web application. Hence I wrote below simple code.
CultureInfo cu = new CultureInfo("ja-JP");
System.Threading.Thread.CurrentThread.CurrentCulture = cu;
System.Threading.Thread.CurrentThread.CurrentUICulture = cu;
lbl1.Text = DateTime.Now.ToString("dd-MMM-yyyy");
But found that the label prints the month number instead of the month name. i.e. it shows 30-10-2014 instead of something 3 letter month name in japanese.
After debugging I came to know that the below property has month names in number instead of 3 letter month name.
> cu.DateTimeFormat.AbbreviatedMonthNames {string[13]}
> [0]: "1"
> [1]: "2"
> [2]: "3"
> [3]: "4"
> [4]: "5"
> [5]: "6"
> [6]: "7"
> [7]: "8"
> [8]: "9"
> [9]: "10"
> [10]: "11"
> [11]: "12"
> [12]: ""
So is Japanese culture a special case or what I am trying to achieve is not possible. Note that if I change the culture to Chinese i.e. "zh-cn" I get correct chinese short month names.