G
Guest
Dear all,
i have a date in the format yyyyMMdd. When I try to parse this I get the
following error: string was not recognized as a valid datetime.
I use the following code:
CultureInfo culture = new CultureInfo("en-US");
culture.DateTimeFormat.DateSeparator = string.Empty;
culture.DateTimeFormat.ShortDatePattern = "yyyyMMdd";
// Here the error occurs:
DateTime date = DateTime.Parse("20041123", culture.DateTimeFormat);
Thanx,
René
i have a date in the format yyyyMMdd. When I try to parse this I get the
following error: string was not recognized as a valid datetime.
I use the following code:
CultureInfo culture = new CultureInfo("en-US");
culture.DateTimeFormat.DateSeparator = string.Empty;
culture.DateTimeFormat.ShortDatePattern = "yyyyMMdd";
// Here the error occurs:
DateTime date = DateTime.Parse("20041123", culture.DateTimeFormat);
Thanx,
René