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
CRM SupportCRM Support 

Contract Date Field issue

Hi Team,

We are facing an issue with a date field in Salesforce. The complete object is populated by a batch job by reading a csv file.  The object has few date fields. One of the date fields is populating incorrectly. That is always populating as one day less than the actual date supplied, where as remainign all the fields are getting populating correctly. 

I've verified the success file that generated after the upsert operation by job and observed that the success file also contains the date supplied in source csv file. Not sure where the problem is? Could someone help in resolving this issue.  There is no trigger associated with that field as as well.

Please let us know for any more details. 

Thanks, 
Kishore
RWE Npower
Bhanu MaheshBhanu Mahesh

Hi Kishore,

Can you please check whether this Contract Date field is  actually a Date field or Date/Time field?

This may be due to that because it is a Date/Time field.

When loading data into date fields such as Opportunity Close Date using the Data Loader, the date displayed in the application is sometimes one day earlier than the date in the file.

The reason for this is that fields such as Close Date are actually date/time fields.  When a date is loaded without specifying the time, the time is defaulted to 00:00 - midnight.  When another user is in a time zone which is behind the current user's time zone, the date will show on the previous day.  For example:

20 August 2008 00:00 in Paris is 19 August 2008 23:00 in London

Similar issues can arise when daylight savings time begins or ends.

https://help.salesforce.com/HTViewSolution?id=000005099&language=en_US (https://help.salesforce.com/HTViewSolution?id=000005099&language=en_US)

Apex Data loader uses API to process everything and so as Apex. As you mentioned you are populating data through batch apex. Both Batch apex and Data loaer will perform similar.

One last thing to consider, if your organization is uses multiple time zones each user will see a time in their configured time zone, in some cases this may make times show up as a day before or a day after which can be problematic in reporting. Because of this it can make sense when making artificial date times like in our example to instead set them to 12:00PM so most time zones will still be on the same day. Furthermore, if you are a multiple time zone org and you need to report across date times constantly across the entire organization you can use a formulato create a date/time field that will display in a specific time zone rather than the current users time.

http://fullcirclecrm.com/excel-datetime-formatting-for-salesforce-imports/


Mark this as "SOLVED"  if your query is Answered.

Thanks & Regards,
Bhanu Mahesh Gadi

Mike ArthurMike Arthur
Hi Kishore,

Did you find a resolution to this?  I am finding the same.

Contract Start Date and End Date fields are 'Date' fields but they populate one day earlier than in the csv import file when using Data Loader.

Might just have to add one day to values in import file!

Thanks,
Mike.
Mike ArthurMike Arthur
So I added a day to the date in my 1 row test import and it imported with the date that I wanted.  I applied the same to entire import file, imported and some had the date I wanted and some had a day later so that's not consistent.  I deleted the imported records.

However, if you go to 'Settings' menu in Data Loader and select 'Settings', there is a field for 'Time Zone'.  Mine was set to 'Europe/London'.  I changed it to 'GMT', imported with date values in import file as the dates that I wanted and they all imported correctly.