tags:

views:

3682

answers:

4

I want to Change the Format of date selected in DateTimePicker in WPF Application

A: 

Typically the date time format is stored in a resource file, because this would help in internationalization of the app.

You can pick up the format from the resource file & use a ToString(DATE_FORMAT)

in your case you might want to use

dateTimePicker.SelectedDate.ToString("dd-MMM-yyyy");

AB Kolan
+1  A: 

dateTimePicker.SelectedDate.ToString("dd-MMM-yyyy"); this will return the string but not the date format in datepicker? how to do that?

A: 

In XAML:

<toolkit:DatePicker SelectedDateFormat="Long" />

or

<toolkit:DatePicker SelectedDateFormat="Short" />
Stuart Campbell
A: 

DatePicker1.SelectedDate = DatePicker1.SelectedDate.Value.ToString("dd/MM/yyyy")

Dee