MinnPost / object-sync-for-salesforce

WordPress plugin that maps and syncs data between Salesforce objects and WordPress objects.
https://wordpress.org/plugins/object-sync-for-salesforce/
GNU General Public License v2.0
93 stars 48 forks source link

Check all stored datetimes for timezones #503

Open jonathanstegall opened 1 year ago

jonathanstegall commented 1 year ago

Is your feature request related to a problem? Please describe. I think it would be nice if all datetime values were stored in the database as UTC and then converted to local, but I don't think that is actually what happens.

To verify this:

  1. Set up the plugin in WordPress with a default (UTC) timezone. Turn on debug mode.
  2. Run Salesforce sync tasks
  3. Change the timezone to something local, ex Chicago.
  4. Try to run the same Salesforce sync tasks. For example a manual user push/pull from the user profile.
  5. See a log entry: "Notice: : Did not sync WordPress user with ID of whatever with Salesforce Id whatever because the last sync timestamp was greater than the object updated timestamp."
  6. Switch it back to UTC and repeat. Nothing prevents it from happening.

Describe the solution you'd like I think it would be nice if all datetime values were stored in the database as UTC and then converted to local.

jonathanstegall commented 1 year ago

I'm not really sure what the backward compatibility of this would be. It would be nice if it didn't break anything, but that will need testing.

jonathanstegall commented 1 year ago

Related issue: https://github.com/woocommerce/action-scheduler/issues/765