I have use case where the a local Agent sends date time to backend WCF service as JSON. The date time serialized by the agent looks like this
Date(1452450600000+0530)
The WCF service acts as a virtualization layer by accepting a DTO and serializing it to a disk to be processed asynchronously.
However when the JSON gets deserialized in WCF service which is running unders PST time, the JSON loses the local time information and the time is represented in PST. ie, +5:30 is replaced by -8:00 with the time change correspondingly.
The problem is that Agents are installed on system operation in multiple timezones and it is important for the system to maintain the timezone information till the end.
Is it possible to keep the client date time intact in WCF serviceand prevent the conversion to PST
Serialization method is
if (obj == null) return null; Type type = obj.GetType(); var ser = new DataContractJsonSerializer(type); using (var ms = new MemoryStream()) { ser.WriteObject(ms, obj); return Encoding.UTF8.GetString(ms.ToArray()); }