xxxxxxxxxx
string s = "2011-03-21 13:26";
DateTime dt =
DateTime.ParseExact(s, "yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture);
xxxxxxxxxx
using System.Globalization;
DateTime.ParseExact("20200101123000", "yyyyMMddHHmmss", CultureInfo.InvariantCulture)
xxxxxxxxxx
string dateTimeString = "2022-08-15 14:30:00";
DateTime dateTime = DateTime.Parse(dateTimeString); // Parsing string to DateTime object