I am trying to verify that the C # string is in the DateTime XML Schema format. Looking at MSDN, it seems that the standard format strings "o", "s" or "u" can describe valid dates, but I cannot get DateTime.ParseExact to work for me. What am I doing wrong here?
string myDate = "1999-05-31T13:20:00.000-04:00"; DateTime.ParseExact(myDate, "o", CultureInfo.InvariantCulture, DateTimeStyles.None); DateTime.ParseExact(myDate, "s", CultureInfo.InvariantCulture, DateTimeStyles.None); DateTime.ParseExact(myDate, "u", CultureInfo.InvariantCulture, DateTimeStyles.None);
None of the above work. Sorry if my formatting is bad: for the first time I am asking a question here.
c # datetime xsd
geardan
source share