mithun kumar

mithun kumar

  • NA
  • 20
  • 17.7k

Converting string to Datetime

Jun 3 2012 3:58 AM
Hello Friends,

I have two Datetime as string and trying to convert this string to Datetime as follows:

 DateTime Dt = Convert.ToDateTime(sEstDate);
            string sDt = Dt.ToString("dd-MM-yyyy HH:mm:ss");
            DateTime dtt = Convert.ToDateTime(sDt);

But its giving me the Error:
"String was not recognized as a valid Datetime"

Thanks & Regards,
Mithun.

Answers (3)