What is the best way to convert string to date in C# if my incoming date format is in YYYYMMDD
YYYYMMDD
Ex: 20001106
20001106
Use DateTime.ParseExact(). Something like:
string date = "20100102"; DateTime datetime = DateTime.ParseExact(date, "yyyyMMdd", CultureInfo.InvariantCulture);
1.4m articles
1.4m replys
5 comments
57.0k users