Musings
Public · Protected · Private
convert string to date yyyymmdd
-
2009-11-13 23:14Regex regex = new Regex(@"^\d{8}$", RegexOptions.Compiled); if (!strVal.IsNullOrEmpty() && regex.Match(strVal).Success) { return DateTime.ParseExact(strVal, "yyyyMMdd", CultureInfo.InvariantCulture); }
This blog is frozen. No new comments or edits allowed.