I need to know the optimal way of writing/reading DateTime
into/from XML. Should I directly write DateTime
into XML or DateTime.ToString()
into XML?
Second question is how to read the date element from XML. Can casting be used for this? Eg:
(DateTime)rec.Element("Date").value
Or, do I need to parse the string like this? Eg:
DateTime.Parse(rec.Element("Date").value)