Is it possible to change the serialization format of DateTime.
Basically i want this DateTime output in my xml file after serialization:
yyyyMMddHHmmss
… and a proper DateTime value after deserialization.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cant.
However, If you control both the serializer and the deserializer, you can use the
[XmlIgnore]attribute on the DateTime field, and create a custom property that formats (and parses) a string to the required format.