You may be not able to set the format of DatePicker SelectedDate
to dd/MM/yyyy
in xaml , I tested as below and it showed an error.
There is a description A date that is in one of the formats that are listed in the DateTime XAML Syntax topic.
in the document DatePicker.SelectedDate Property XAML Values part. (DateTime XAML Syntax)
You can use below method to update format in C# code:
Method 1:
var txt = this.dateTimePicker1.SelectedDate.Value.Date.ToString("dd/MM/yyyy")
Method 2:
CultureInfo ci = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name);
ci.DateTimeFormat.ShortDatePattern = "dd/MM/yyyy";
Thread.CurrentThread.CurrentCulture = ci;
var txt = this.dateTimePicker1.SelectedDate.Value.Date.ToShortDateString();
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.