[SalesForce] Auto Data Loader using CLI uploading dates one day back

I'm using ant to operate auto data loader with the CLI.

The dates that I load are uploading with one day back.
I set a variable that get the GMT value but still it isnt working

Here is my process-conf.xml

    class="com.salesforce.dataloader.process.ProcessRunner"
    singleton="false">
    <description>Inserts object records from a CSV file.</description>
    <property name="name" value="Deal__cUpsert"/>
    <property name="configOverrideMap">
        <map>
            <entry key="sfdc.endpoint" value="https://eu6.salesforce.com"/>
            <entry key="sfdc.username" value="xxxxxxx"/>
            <entry key="sfdc.password" value="xxxxxxxxxxx"/>
            <entry key="process.encryptionKeyFile" value="C:\Users\alon\Documents\Data Load/datascripts/dataloader_encryption_key.txt"/>
            <entry key="sfdc.debugMessages" value="true"/>
            <entry key="sfdc.debugMessagesFile" value="C:\Users\alon\Documents\Data Load/orgs/Ampa Capital/data/debug.log"/>
            <entry key="sfdc.timeoutSecs" value="600"/>
            <entry key="sfdc.loadBatchSize" value="50"/>
                <entry key="sfdc.externalIdField" value="External_Id__c"/>
            <entry key="process.operation" value="upsert"/>
            <entry key="dataAccess.type" value="csvRead"/>
            <entry key="sfdc.entity" value="Deal__c"/>
            <entry key="dataAccess.name" value="C:\Users\alon\Documents\Data Load/datascripts/datafiles/EquipTradeImport.csv"/>
            <entry key="process.mappingFile" value="C:\Users\alon\Documents\Data Load/datascripts/mappingfiles/EquipTradeImportMap.sdl"/>
            <entry key="process.outputSuccess" value="C:\Users\alon\Documents\Data Load/orgs/Ampa Capital/data/Deal__cEquipTradeImport_success.csv"/>
            <entry key="process.outputError" value="C:\Users\alon\Documents\Data Load/orgs/Ampa Capital/data/Deal__cEquipTradeImport_error.csv"/>
            <entry key="sfdc.timeZone" value="GMT"/>
            <entry key="process.useEuropeanDates" value="true"/>


        </map>
    </property>
</bean>

Thanks

Best Answer

As you have correctly guessed the timezone is an issue.

It is best to format date values in your CSV file such that they include both time and timezone, to make it independent of your computer timezone and SFDC Org default timezone.

From the documentation: https://help.salesforce.com/articleView?id=000004680&language=en_US&type=1

Example scenarios

Scenario: If your org's time zone is set as "China/Taiwan time zone GMT+8":

"Date" and Data Loader time zone is GMT+0, GMT, or blank

Your example data in your import spreadsheet can be either:

2011-01-10
2011-01-10 00:00:00
2011-01-10T00:00:00Z
2011-01-10T00:00:00.000Z

"Date" and Data Loader time zone is GMT+8

Your example data in your import spreadsheet must be either:
2011-01-10 08:00:00
2011-01-10T08:00:00Z
2011-01-10T08:00:00.000Z

Note: If you set the hh:mm:ss to 00:00:00, the Import Date data in Salesforce will display the previous day ('2011-01-09' instead of '2011-01-10').

You will find more details and examples by the link I mentioned above.

Related Topic