datetime converter WPF
I have this converter that i made to get the current time once the date is
selected from the DataPicker. In string Date i am getting the value that
was selected from the DatePicker, but i cant seem to only get the date.
The fromate that is coming into the Value property is 9/24/2013 12:00:00 I
would like it to be 9/24/2013
the error i am getting is "Error 122 No overload for method 'ToString'
takes 1 argument"
public object Convert(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
if (value is DateTime)
{
string date = value.ToString("d/M/yyyy");
return (date);
}
return string.Empty;
}
No comments:
Post a Comment