1

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.

thinkmmk
  • 487
  • 1
  • 8
  • 22
  • Could it be that Japanese culture actually uses numbers on month abbreviation, or it might be your machine that does not have the correct Japanese culture installed? In any case the culture settings are machine based and you should respect them. – Pedro.The.Kid Oct 30 '14 at 11:11
  • This [is normal](http://msdn.microsoft.com/en-us/goglobal/bb688124.aspx). Keep in mind that abbreviations are uncommon in a writing system that already uses a single character to represent a word :) – Hans Passant Oct 30 '14 at 11:49
  • @HansPassant Don't you mean Double byte single character? – KyloRen Dec 20 '19 at 03:43

0 Answers0