Forum Discussion

darshthakkar's avatar
darshthakkar
Valued Contributor
4 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 developi...
  • darshthakkar's avatar
    4 years ago

    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.