XmlSerializer.Deserialize method appends timezone to a time and datetime field

Posted by G33kKahuna on Stack Overflow See other posts from Stack Overflow or by G33kKahuna
Published on 2010-03-30T21:23:46Z Indexed on 2010/03/30 21:33 UTC
Read the original article Hit count: 265

Have a small script in Microsoft.NET 2.0 that deserializes a XML back to a typed object, connects dyanimcally to a web service using ServiceDescription and binds the deserialized typed object to the WebMethod inbound. The XML prior to serialization looks like below

<completion_time>12:19:38</completion_time> 

on the wire when communicating to the web service looks like below

<completion_time>12:19:38.0000000-04:00</completion_time>

with the timezone appended to the end. This is causing the time to be read differently when communicating to a web service at a different timezone. is there anyway to let XmlSerializer skip the timezone? Or any other known workarounds?

© Stack Overflow or respective owner

Related posts about web-services

Related posts about timezone