Yes, in a few corner cases we might get this behaviour if there is a bi-directional sync of licenses with Salesforce and the format in Salesforce is simple Date rather than Datetime.
Here’s the background..
Dates are saved in Planhat as date-times, using the exact moment (date picked + local time) but converted to UTC (server time).
When displayed back to Planhat user it shows the correct date as UTC-time module converts UTC date time to the corresponding local moment.
When importing licenses (excel-import) we only have info about the date (typically), so we “dress” it with info about the hour (moment) before saving.
When syncing to Sales force 2 scenarios are possible.
- Field in SF is Date
- Field in SF is Datetime
If SF field is date time all is good, since we send our correct date time and get the same thing back.
When we save our date time to a date-field however, then we lose info about the hour -nothing to do about it.
When synced back from Salesforce to Planhat we only have the date and info about original hours is lost.
To make a “best guess” we’ll save it as noon (UTC), since that will display correctly for most other time zones.
This will produce some weird behaviour when:
- License saved before 7 am PST (date will appear to have jumped back a day after SF sync)
- Licenses saved before 7 am HKT (date will appear to have jumped back a day after SF sync)
Example 1 (PST = UTC -7)
If a date for example was saved at noon 2016-04-15 12:00:00 PST (PST), it will be converted to 2016-04-15T19:00:00Z (UTC) in Planhat.
Then if synced to SF (as a plain date) it is saved as 2016-04-15 in SalesForce.
When synced back from our “best guess” is 2016-04-14T12:00:00Z (UTC).
In local time will now display as 2016-04-15 05:00:00 PST. (same date, and user wont notice hours has jumped since we only show date and that’s the same)
Example 2 (HKT = UTC+8 )
Saved in Hong Kong 2016-04-15 07:00:00 (HKT) , it will be converted to 2016-04-14T23:00:00Z (UTC).
Synced to SF as 2016-04-14.
When synced back from Salesforce to Planhat “best guess” is 2016-04-14T12:00:00Z (UTC).
In local time it will now display as 2016-04-14 20:00:00 (Date jumped back a day)