Prevent timezone conversion on deserialization of List<DateTime> Collection
<p>I have a class which I use the XmlSerializer with to serialize data to and from XML files.</p>

<p>I have several DateTime properties. In the post, <a href="https://stackoverflow.com/questions/3188933/prevent-timezone-conversion-on-deserialization-of-datetime-value">Prevent timezone conversion on deserialization of DateTime value</a> the answer correctly removes timezone offsets from DateTime properties.</p>

<p>However, I have a property which is a list of DateTime objects that I can't remove the timezones from.</p>

<pre><code>[XmlElement]
public List&lt;DateTime&gt; Times {get; set;}
</code></pre>

<p>I have tired something like this, but the value is always null and none of the data is correctly serialized to the list property.</p>

<pre><code>[XmlIgnore]
public List&lt;DateTime&gt; Times {get; set;}

[XmlElement(ElementName = "Times")]
public List&lt;string&gt; TimesString
{
 get
 {
   return Times.ForEach(fe =&gt; RemoveTimeZone(fe));
 }
 set
 {
   foreach(var v in value)
   {
     Times.Add(ConvertToDate(v));
   }
 }


}
</code></pre>

<p>The value property is always empty and both list properties are always empty. </p>

<p>My goal is to not create a new class, but to somehow bind directly to my list properties.</p>