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#

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.