2

I have converted datetime value in unicode using following code -

CultureInfo cultureMarathi = new CultureInfo("mr-IN");
nextCheckDate=nextCheckupDateTimePicker.Value.ToString("dddd, dd-MMM-yyyy", cultureMarathi);

It converts my datetime to "गुरूवार, 26 मे 2016" but the digits are still in roman script. How to convert these digits as per the culture.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
AshishAim
  • 121
  • 1
  • 6
  • I'm not sure about this, but can you check if your font has digits in local script? – Umesh CHILAKA May 26 '16 at 03:43
  • 1
    I *think* digit substitution takes place during rendering, not when the string is formatted. See [How can I display culture-specific native digits instead of Arabic numerals?](https://stackoverflow.com/questions/6239729) and [C# WPF Converting english numbers to arabic numbers](https://stackoverflow.com/questions/1643740). – dbc May 26 '16 at 03:50
  • @jdweng: this question is closed for a reason, don't add answers to the question post please. – Martijn Pieters May 26 '16 at 16:04

1 Answers1

1

Try this:

CultureInfo cultureMarathi = new CultureInfo("mr-IN");
cultureMarathi.NumberFormat.DigitSubstitution = DigitShapes.NativeNational;
nextCheckDate=nextCheckupDateTimePicker.Value.ToString("dddd, dd-MMM-yyyy", cultureMarathi)
Thread.CurrentThread.CurrentCulture = cultureMarathi;
Ebad Masood
  • 2,389
  • 28
  • 46