Hi, I using WPF -> XAML and I have a DatePicker.
My question is: How do I change the DatePicker date format to yyyy-MM-dd using XAML or C# ?
I really need help PLEASE.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mageshwaran RPosted Nov 24, 2019, 12:17 PM
Tom MohanPosted Apr 3, 2015, 11:40 AM
Guest UserPosted Apr 3, 2015, 10:58 AM
Tom MohanPosted Apr 3, 2015, 9:09 AM
in pageload/ctor
CultureInfo ci = CultureInfo.CreateSpecificCulture(CultureInfo.CurrentCulture.Name);
ci.DateTimeFormat.ShortDatePattern = "yyyy-MM-dd";
Thread.CurrentThread.CurrentCulture = ci;
property
private DateTime dateOfBirth = DateTime.Now;
public DateTime DateOfBirth
{
get { return dateOfBirth; }
set { dateOfBirth = value;
OnPropertyChanged("DateOfBirth");
}
}
xaml
Guest UserPosted Apr 3, 2015, 8:41 AM
Tom MohanPosted Apr 3, 2015, 8:26 AM
Guest UserPosted Apr 3, 2015, 7:45 AM
Tom MohanPosted Apr 3, 2015, 7:38 AM
Use StringFormat in XAML