0

How can i change DatePicker DisplayDate from mm/dd/yyyy to yyyy-mm-dd ?

H.B.
  • 142,212
  • 27
  • 297
  • 366
Vero009
  • 602
  • 3
  • 18
  • 31

1 Answers1

1

Change the SelectedDateFormat to 'yyyy-MM-dd'

If you want to set the culture correctly for your entire app, look at this question: StringFormat Localization issues in wpf.

You need this code somewhere that runs on startup.

FrameworkElement.LanguageProperty.OverrideMetadata( typeof(FrameworkElement), 
    new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
Community
  • 1
  • 1
Ray
  • 44,685
  • 26
  • 123
  • 168