I have a raddatetimepicker control with the dateFormat and displayDateFormat set to 'MM/dd/yyyy HH:mm'.
However, when I retrieve the SelectedDate from the code behind, it is in a different format 'MM/dd/yyyy HH:mm:ss'.
I do not want the seconds. How can I get around this problem?
If I set the dateTime.SelectedDate = DateTime.Now() then
dateTime.SelectedDate.GetValueOrDefault(DateTime.MinValue) returns something like 03/09/2009 10:57:28 even though the dateFormat is "MM/dd/yyyy HH:mm". I would at least expect the seconds component to be 00 when formatted this way.
Perhaps this is expected behavior because the actual value set DateTime.Now does have the seconds component.
I still need a workaround. Would overriding the SelectedDate property be the best approach?