Answers for "how to parse string to datetime c#"

C#
26

c# string to datetime

string iDate = "05/05/2005";
DateTime oDate = Convert.ToDateTime(iDate);
MessageBox.Show(oDate.Day + " " + oDate.Month + "  " + oDate.Year );
Posted by: Guest on March-08-2020
1

parse datetime c#

using System.Globalization;
DateTime.ParseExact("20200101123000", "yyyyMMddHHmmss", CultureInfo.InvariantCulture)
Posted by: Guest on January-05-2021

C# Answers by Framework

Browse Popular Code Answers by Language