the code:
DateTime.Now.AddHours(-3).AddMinutes(-33).AddMonths(3).AddDays(21).ToString("ddMMMy Hmm")
gives the result:
28May19 901
Hovever when I pass this date into the TryParseExact method I get the following :
DateTime.TryParseExact("28May19 901", "ddMMMyy Hmm", null, System.Globalization.DateTimeStyles.None, out dt);
false
How could this be false? and what would the correct format be?
EDIT:
CultureInfo.InvariantCulture does not make a difference:
DateTime.TryParseExact("28May19 901", "ddMMMyy Hmm", CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out dt); false