Contacts that had not been edited were repeatedly logged as “Updated contact from Google to Outlook.” Change detection compares Google’s update timestamp with the last-sync time stored in an Outlook custom field.
GetGoogleLastUpdated read Google’s DateTimeOffset using .DateTime. That returns the UTC clock time with DateTimeKind.Unspecified. The subsequent conversion only converts values marked Utc, so it left the Google timestamp in UTC. The last-sync time is stored using local time (DateTime.Now). Comparing those different clock bases made Google’s timestamp appear hours newer than the last sync, exceeding the 120-second tolerance and falsely marking the Google contact as changed.
Convert the Google DateTimeOffset to local time when reading it. In ContactPropertiesUtils.cs, replace .DateTime with .LocalDateTime:
- lastUpdated = time.DateTime;
+ lastUpdated = time.LocalDateTime;
After the fix, Google’s update timestamp and Outlook’s stored last-sync timestamp use the same local time basis. Unchanged contacts should no longer be repeatedly classified as changed on Google and rewritten to Outlook.
Fix
Convert the Google
DateTimeOffsetto local time when reading it. InContactPropertiesUtils.cs, replace.DateTimewith.LocalDateTime:Expected result
After the fix, Google’s update timestamp and Outlook’s stored last-sync timestamp use the same local time basis. Unchanged contacts should no longer be repeatedly classified as changed on Google and rewritten to Outlook.