title: How to handle that "Local Time to UTC Conversion" differently implemented in .NET / java
body: <p><strong>.NET Web Service</strong><br>
  I have a .NET web service which returns json formatted DateTime's.
  The json representation of a DateTime specified by Microsoft is for example:<br>
  /Date(1302847200000+0200)/<br>
  This is according to <a href="http://msdn.microsoft.com/en-us/library/bb412170.aspx" rel="nofollow">MSDN - Stand-Alone JSON Serialization</a> the millisecond offset since the first of January 1970 in UTC before the +/- sign and after the sign the time zone offset of the local time to GMT. So for this serialization the DateTime value must be converted from the web service's local time to UTC.</p>
  
  <p><strong>Android (java) Client</strong><br>
  In my Android application, which receives the web service results, I parse json using Gson. Because the .NET DateTime json serialization is not a standard (according to Microsoft there is no such standard for DateTime) gson is not able to parse such formatted dates. I wrote a Date TypeAdapter which does the serialization and deserialization on the client side.  </p>
  
  <p>So this seems to work fine. DateTime exchange from and to service in UTC. It would be fine, if .NET's DateTime and Java's Calendar would regard totally the same rules when it comes to conversion of local to UTC time.</p>
  
  <p><strong>An example:</strong> Switzerland has DST (Daylight Saving Time) since 1979. Java knows that DST did not exist before. .NET assumes it exists since ever. So when a date in summer before 1979 is converted from .NET to UTC and from Java back to Local time (for presentation), then this date loses an hour in the same time zone.</p>
  
  <p><strong>Question</strong>
  How to face that problem? Is there any mistake I am doing in the described data exchange.
  I thought about many different solutions. The only way which i can imagine to work properly is to replace the .NET json DateTime Serialization/Deserialization. This of course is not a favoured one...</p>
  
  <p>Thanks for your time.</p>