Sync Framework 1.1 over WCF changes DataTable DateTime values when in different timezones RRS feed

  • Question

  • Is there any other solution other than this: http://support.microsoft.com/kb/842545?

    Seems like i should be able to store an extended dataset property or something that forces the computation to result in a net 0 for time differences.  Is there a WCF setting, DataSet property or SF client parameter i can set?

    Tuesday, February 1, 2011 9:27 PM


  • Hi,

    When you use ADO.NET to serialize and deserialize the DataTable over WCF, the default deserialization behavior is to adjust the datetime values to the destination machine's local time zone.  The workaround as mentioned in the article is to also pass in the source machine's time zone, so that the destination machine can readjust the datetime values in the DataTable after deserialization.  Sync Framework is agnostic as to the content of the data and doesn't have a client parameter that can be set to affect a specific data type -- in this case datetime.

    Another approach you could try is to override the default serialization and deserialization methods with your own serialization and deserialization methods, so that you have control over how the datetime values are deserialized on the destination machine such that they will not be automatically adjusted to the destination machine's local time zone.



    Saturday, February 5, 2011 1:54 AM