function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
santhoshsanthosh 

DateTime stamp mis-match in Salesforce UI

When we create Events through Partner API (.Net), the ActivityTime field displayed on Salesforce UI is not matching with what is actually entered by the user.  But when we retrieve the record through API and show, it does appear correctly.  We are converting the datetime format to UTC before inserting in to salesforce.
santhoshsanthosh

Since no one replied to our earlier post, I'm redefining the problem with a hope of getting some reply.

Typical Scenario:

 

  1. SF User Time Zone is PST.
  2. Server where the Appxchange Application is running is in EST.
  3. User will be entering date time values in PST.
  4. Date Time value is converted to UTC and inserted in to SF through API.
  5. When this record is viewed through SF UI the value will be some thing different than what was entered by user.
  6. When this record is viewed through Appxchange Application's UI, the value will be correct.

 

If we do not convert the value to UTC, the record viewed through SF UI and AppEx UI would be some thing different than what was entered.  We have tried different work arounds like, adding Time Zone offset hours etc but without any results.

 

No post in this forum or any other SF resource seems to have answered this to the development community's satisfaction.  We are already serving our customers through some AppExchange implementations and problems of this kind are really putting us off Salesforce.  We are trying to do some serious stuff with Salesforce AppExhange and quite often we come across issues, which does not have a solution or we are not made aware about the same.

 

 

SuperfellSuperfell
DateTimes are always shown in the users selected timezone in the UI.

When you convert the from the entered time to UTC and send the dateTime to salesforce, are you indicating that it's already in UTC (via the trailing Z specifier).

Perhaps you could post an example with specific dateTimes at each point. DateTime's in the API all use ISO8601 formatted dateTime as required by the XML Schema specificiation, and this format includes a TZ specifier, so once you're at the point of using the API, there's no ambiguity, however, most languages don't have a TZ aware dateTime class, so you as the developer are responble for managing the TZ info out of band of the actual DateTIme object, and making sure you understand what (if any) TZ corrections the soap stack you're using will do. (for example, .NET typically assumes your dateTime instances are in the local time of the app server and will auto convert them to UTC to send over the wire, and perform the reverse conversion when de-serializing data, perhaps you're double offsetting for UTC?).