I have a data string 'yyyymmddhhmmss' example: '20101001151014', how Do I parse this to date in C#?
DateTime when = DateTime.ParseExact("20101001151014", "yyyyMMddHHmmss",
CultureInfo.InvariantCulture);
Points to note: 24-hour hour is HH; 2-digit month is MM
Use the DateTime.ParseExact method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With