How to convert string to datetime datatype?
C#
3
Posts
3
Posters
0
Views
1
Watching
-
How can perform following conversion (string to datetime)? string s="January 1, 1986" to DateTime datatype
shahdat
-
How can perform following conversion (string to datetime)? string s="January 1, 1986" to DateTime datatype
shahdat
string s = "January 1, 1986";
DateTime dt;
if (!DateTime.TryParse(s, out dt))
// failed
else
// use dt here.Navaneeth How to use google | Ask smart questions
-
How can perform following conversion (string to datetime)? string s="January 1, 1986" to DateTime datatype
shahdat
Dude try this String s = "January 1, 1986"; DateTime t1 = DateTime.ParseExact(s, "MMMM d, yyyy", null);