How to convert sting to datetime format like MM/dd/yyyy
问题 i get the string value like 01/05/2012(MM/dd/yyyy) , now i have to convert into datetime string s="01/05/2012"; datetime dt=convert.todatetime(s); Now dt value is 1/5/2012, but i have to get dt value 01/05/2012, how to get the value , plese give me any idea about that. Thanks hemanth 回答1: You are creating your DateTime object correctly, you are just looking at the internal representaion of the DateTime. The way that it is output depends on the Format String you give its ToString Method. i.e.: