Forum Discussion

darshthakkar's avatar
darshthakkar
Valued Contributor
3 years ago
Solved

Date in Salesforce acceptable format

Hi Team,

I have 2 fields, Start and End Date coming from upstream systems (i.e. snowflake) in UTC and want this to be inserted to downstream systems (i.e. Salesforce) in UTC as well. After developing the pipeline, we found that the dates are off by 4 hours when it goes into Salesforce.

Thus, I tried changing the date to EST format in order to resolve the issue however at Salesforce, the dates are further going off by 4 hours.

Should I just add 4 hours in my mapper which formats date so that it goes as is in Salesforce? If that’s the case, how should I add those 4 hours? It seems like the Salesforce Org is GTM-4 therefore it always converts the time - 4hours.

Some screenshots for convenience.

  1. Snowflake execute with the below settings:

  2. EST Add-on:

With the EST add on, the dates on Salesforce is going as 2025-12-29T15:00:00Z which is 29 Dec 2025 3pm.

  1. Removed EST Add-on:

While removing the EST add-on, dates on Salesforce is still going as (Date - 4 hours) i.e. 29 Dec 2025 8pm.

How can I tackle this?

Thanking in advance for your time.

Regards,
Darsh

  • Based on how the Org has been setup in downstream systems, transformations must be made in snapLogic. For me, Salesforce Org is GMT-4 thus, I adjusted the date accordingly using

    $Expire_Date.plusHours(4).toLocaleDateTimeString({format: "yyyy-MM-dd'T'HH:mm:ss'Z'"})

    Moreover, it is vital to check the data type at the downstream systems as well. We may be ingesting wrong data and thus the dates might be off and not consistent. For example, I’m ingesting Date/Time but Salesforce Org is only Date then it wouldn’t make sense.

    Consequently, another function can also be used which is as below:

    $Expire_Date.toLocaleDateTimeString({format: "yyyy-MM-dd'T'HH:mm:ss'Z'","timeZone":"GMT"})

    $Expire_Date.toLocaleDateTimeString({format: "yyyy-MM-dd'T'HH:mm:ss'Z'","timeZone":"GMT+4"})

    Closing this thread now as the issue has been found at the downstream systems and not with snapLogic plus it has been resolved too.
    Thank you everyone for your time, help and inputs on this one.