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
Nikki.ax79Nikki.ax79 

GMT/UTC time roll back also rolls date back?

I am using Java and the 4.0 partner API.

In writing dates to Salesforce it is a given that Salesforce expects times are GMT. Specifically, I am writing DueDateTime to an Activitiy. I need times to reflect as CST so I make some changes to the time portion before I send the data on to Salesforce. The datetime is sent to Salesforce as 2005-11-07T04:59:00Z. When I view the data in Salesforce the due date time is shown as 11/6/2005 10:59pm. The time has been correctly assumed GMT then rolled back to CST (GMT - 7hours), but the date also rolls back a day which I didn't anticipate.

Salesforce documentation states the following regarding the DueDateTime field for Activities: "This field is a regular Date/Time field with a relevant time portion. The time portion is always transferred in the GMT/UTC time zone. You need to translate the time portion to or from a local time zone for the user or the application, as appropriate." Because the doc says nothing about the date portion I am doing no client-side handling on dates.

Is the date portion of a date/time field rolling back anticipated behavior?

Message Edited by Nikki on 10-14-2004 01:20 PM

DevAngelDevAngel

Hi Nikki,

So, doesn't 4:59 AM minus 7 hours take you to the previous day?  This looks correct.

Nikki.ax79Nikki.ax79
Dave,

It would. However, since Salesforce documentation only states rolling the time portion of the date/time field back I've made no handling for the date portion of the date/time field. A little clarification in the documentation would be helpful.

Thanks,
Nikki
EnderEnder
Nikki,

Also, are you using Axis? Because if you are, it may be an issue with the way that Axis serializes Dates.

If you create a date object in Java and then send it to sfdc via Axis, Axis will automatically convert the date to UTC from the current timezone. Since a date object without a time is represented as midnight, this causes the day to rollback for certain timezones.

Check the xml (via tcpmon or other monitor) that you are sending up just to verify that Salesforce is actually rolling back the date, and not the client-side Axis.