Category: ASP
C# How to convert String to DateTime
DateTime dt = DateTime.ParseExact("2006", "yyyy",CultureInfo.InvariantCulture); DateTime dt = DateTime.ParseExact("20060531", "yyyyMMdd",CultureInfo.InvariantCulture); DateTime dt = DateTime.ParseExact("2006/05/31", "yyyy/MM/dd",CultureInfo.InvariantCulture);
C#