How to convert Object type to DataTime?

Dec 21 2008 12:11 PM

Hi,

Could you please let me know how to convert object type to DataTime type. You can refer the below code for more information

internal object Value
{
 set
 {
  DateTime dt = Convert.ToDateTime(value);
  this.SelectedDate = (dt == DateTime.MinValue)?null:dt.ToString("dd-MMM-yyyy");
 }
}

value being passed to Value property is "19/12/2008 00:00:00".

Regards,
Atheeq


Answers (1)