WPF Toolkit, How to apply date format in C# for datepicker control?

后端 未结 3 417
离开以前
离开以前 2021-01-20 00:07

WPF Toolkit, How to apply date format in C# for datepicker control?

3条回答
  •  执笔经年
    2021-01-20 01:08

    I found the one way to solve of my problem by using the culture

    System.Globalization.CultureInfo culInfo = new System.Globalization.CultureInfo("en-us");
    
    System.Globalization.DateTimeFormatInfo dtinfo = new System.Globalization.DateTimeFormatInfo();
    
    dtinfo.ShortDatePattern = "dd-Mon-yyyy";
    
    dtinfo.DateSeparator = "-";
    

    And apply this short date pattern to date time picker.. It works

提交回复
热议问题