Hi All,
I have a string s that is "10/29/2006". I want to convert this string to datetime format.
used the method
DateTime dt=System.Convert.ToDateTime(s);
But it is giving an error "string was not recognised as a valid datetime. Please help me out.
Loading
shinoy alphonsePosted Nov 28, 2006, 3:33 AM
Use this code
DateTime.Parse(txtStartDate.Text).ToString("yyyy/MM/dd")
also i suggest you to chage ur system datetime settings to the above mentioned format
Mahesh JoshiPosted Nov 28, 2006, 2:05 AM