.NET Strategies
Why reinvent the wheel?
Thursday, August 25, 2016
C# convert string YYYYMMDD string to datetime
Use
DateTime.TryParseExact
.
var
newDate =
DateTime
.
ParseExact
(
"20160823"
,
"yyyyMMdd"
,
CultureInfo
.
InvariantCulture
);
Add if not already referenced
using System.Globalization;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment