I have an Xml element that needs to contain DateTime of Year, Month, Day, Hour, Min, Sec and MS
I later need that that Xml element be casted via XMLDeserializer, to DateTime object.
I know that there are some issues with DateTime Format casting, My question is what is the DateTime Format that i should write the Xml Element so once i deserialize it via XMLDeserializer i will not have any issues to cast to DateTime object
I would like to have answer like: {0:MM/dd/yy H:mm:ss zzz}
or any other Format that will definatelly work
Internally XmlSerializer
uses XmlConvert
which converts DateTime
using following format:
yyyy-MM-ddTHH:mm:ss.fffffffzzzzzz
Anyway use ISO 8601 format. In .NET you can use o
format specifier:
dateTime.ToString("o")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With