Sorry if this is not an MbUnit-specific question (this may be a general date
question).

I am parsing a date from an XML report like so:

XmlDocument doc = new XmlDocument();
doc.Load("myreport.xml");
XmlElement reportResultNode = (XmlElement) doc.GetElementsByTagName
("report-result")[0];
string dateStr = reportResultNode.GetElementsByTagName("date")[0].InnerText;
DateTime dt = methodThatINeed(dateStr);

I am looking for the simplest reliable way to convert a string like that
into a DateTime object, e.g I need to implement that "methodThatINeed"
method.

I have not encountered a date format like this one before:
2007-10-12T17:58:42.9759391-04:00     OR
2007-10-15T19:58:19.235715-04:00
It is not fixed-length, and it has a UTC offset in it. I should not have to
split it into substrings and convert to ints/doubles, if this is a some sort
of standard format.

Any ideas?

Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to