Is there any way I can define how a DateTime should be serialized/deserialized using something similar to the XmlAttribute tag? In the past I would make the field a string and then do something like this in the constructor:
this.DateField = XmlConvert.ToString(passedObject.Date, XmlDateTimeSerializationMode.Utc);
However, I'd like to actually have the field be a DateTime and somehow tag that it should be serialized as UTC:
[System.Xml.Serialization.XmlAttribute()] // XmlDateTimeSerializationMode tag here?
public DateTime DateField;
How would I do that?