.NET Web Service
I have a .NET web service which returns json formatted DateTime s.
The json representation of a DateTime specified by Microsoft is for example:
/Date(1302847200000+0200)/
This is according to MSDN - Stand-Alone JSON Serialization 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.
Android (java) Client
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.
因此,这似乎行不通。 日期 在美洲金枪鱼委交换时间并提供服务。 如果在将当地时间改为万国邮联时,网络的时代和 Java的日历将完全考虑到同样的规则,那将是罚款。
<>光> 自1979年以来,瑞士拥有德国航空航天局。 Java知道,以前不存在数字数据系统。 NET自此就一直存在。 因此,在1979年之前的夏天,日期从......改为: 从网络到UTC,从Java回到当地时间(用于介绍),这个日期在同一个时间区损失了一个小时。
Question 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...
感谢你们的时间。