1

I am using following time format pattern:

column.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
column.DisplayFormat.FormatString = "DD/mm/yyyy hh:mm tt";

It works exactly as expected for US locale. But after changing to Russian locale AP/PM signs disappeared. "<" and ">" appears instead. How to solve it?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
johnny-b-goode
  • 3,792
  • 12
  • 45
  • 68
  • 2
    Yeah, `ru-RU` culture (guessing it's not the Tatar one) does have `AMDesignator` and `PMDesignator` properties as an empty string. You can `Clone` this russian culture and set these properties what ever you want and use _this_ culture as a `Current(UI)Culture` which I'm not 100% sure this will happen for entire application http://stackoverflow.com/questions/468791/is-there-a-way-of-setting-culture-for-a-whole-application-all-current-threads-a – Soner Gönül Sep 11 '15 at 11:38
  • You might look [here](http://stackoverflow.com/questions/5798908/how-to-produce-localized-date-string-with-cultureinfo) for some info on date localization. – jradich1234 Sep 11 '15 at 11:53
  • By the way, there is no `DD` as a custom date and time specifiers. You need to use `dd` instead. Custom specifiers are case sensitive. Also `mm` specifier is for minutes, but `MM` specifier is for months. – Soner Gönül Sep 11 '15 at 13:53

1 Answers1

0

Most people outside of USA use a 24 hour clock; 13:00 instead of 1 PM. It's also problematic to determine if the date is dd/mm or mm/dd; so it good practice to use dd MMM yyyy; e.g. 2 Jan 2015.

So you should use

column.DisplayFormat.FormatString = "dd MMM yyyy HH:mm";
Richard Schneider
  • 34,944
  • 9
  • 57
  • 73