I am trying to parse the following British DateTimestring format :24/01/2013 22:00
However, I keep getting this error:
The string was not recognized as a valid DateTime.
CultureInfo.CurrentCulturereturns " en-GB", which is correct
Here is my code
[TestMethod]
public void TestDateTimeParse()
{
DateTime tester = DateTime.ParseExact("24/01/2013 22:00", "d/M/yyyy hh:mm", CultureInfo.CurrentCulture);
int hours = tester.Hour;
int minutes = tester.Minute;
Assert.IsTrue(true);
}
source
share