I have the following property within a user control:
public DateTime? Value
{
get
{
return DatePickerInput.SelectedDate;
}
set
{
DatePickerInput.SelectedDate = value;
}
}
This selects dates in the following format 01-Feb-2012. I want to change the format so it returns dates in the format dd/MM/yy…how is this possible?
It uses the current culture settings on your computer. If you want that format you need to return it as a string or let your receiving method convert it to string. For example:
I did not take into account that your Value property can also return null value. This is just to show you how to format the result.