This is a migrated thread and some comments may be shown as answers.

DateTimeFormat how to remove AM and PM ?

1 Answer 892 Views
TimePicker
This is a migrated thread and some comments may be shown as answers.
Terrence
Top achievements
Rank 1
Terrence asked on 02 Nov 2011, 06:18 PM

According to their documentation “Link below” to set their date time picker to military time you have to create a new culture. We are using the culture below, as you can see from the screen shot it got it half way right but I think it would be better without the AM & PM after it.I attached a screen shot of the clock. We just want to remove the AM and PM.

 

CultureInfo cultureInfo = new CultureInfo("en-US");

cultureInfo.DateTimeFormat.ShortTimePattern = "H:mm";

cultureInfo.DateTimeFormat.LongTimePattern = "H:mm";

cultureInfo.DateTimeFormat.PMDesignator = "";

cultureInfo.DateTimeFormat.AMDesignator = "";   

 

 

http://www.telerik.com/help/wpf/raddatetimepicker-features-formatting.html

 

1 Answer, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 03 Nov 2011, 10:14 AM
Hi Andrew,

I suspect you do not set RadDateTimePicker's culture:
CultureInfo cultureInfo = new CultureInfo("en-US");
cultureInfo.DateTimeFormat.ShortTimePattern = "H:mm";
cultureInfo.DateTimeFormat.LongTimePattern = "H:mm";
cultureInfo.DateTimeFormat.PMDesignator = " za";
cultureInfo.DateTimeFormat.AMDesignator = " az";
this.RadDateTimePicker.Culture = cultureInfo;

Regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TimePicker
Asked by
Terrence
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or