How to ignore timezone of DateTime in .NET WCF client?

Posted by Net_Dev on Stack Overflow See other posts from Stack Overflow or by Net_Dev
Published on 2010-06-18T06:37:16Z Indexed on 2010/06/18 6:43 UTC
Read the original article Hit count: 907

Filed under:
|
|

WCF client is receiving a Date value from a Java web service where the date sent to the client in XML is :

<sampleDate>2010-05-10+14:00</sampleDate>

Now the WCF client receiving this date is in timezone (+08:00) and when the client deserialises the Date value it is converted into the following DateTime value :

2010-05-09 18:00 +08:00

However we would like to ignore the +14:00 being sent from the server so that the serialised Date value in the client is :

2010-05-10

Note that the +14:00 is not consistent and may be +10:00, +11:00 etc so it is not possible to use DateTime conversions on the client side to get the desired date value.

How can this be easily achieved in WCF?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about wcf

Related posts about datetime