cancel
Showing results for 
Search instead for 
Did you mean: 

Suffixing date with date format abbreviation (e.g. EST, UTC, IST, etc.)

darshthakkar
Valued Contributor

Continuing the discussion from Date in Salesforce acceptable format:

Hi Team,

I actually need the following format for date: 2023-02-28T00:00:00.000 EST
I’m currently using $Expire_Date.toLocaleDateTimeString({“format”:“yyyy-MM-dd’T’HH:mm:ss.SSS”,“timeZone”:“America/New_York”})+" EST" which is working on the output preview but unable to ingest records in the downstream systems i.e. Salesforce. I’m suspecting that the date format is causing an issue as previously without the modification of the Expire Date, the pipeline was able to ingest data downstream. Moreover, the same format of the data is able to go into Salesforce if we do it manually.

Do you agree that the transformation I’m using is correct? Is appending “EST” as a string causing an issue? How can I have EST embedded automatically without writing "+ “EST” "?

Also, if I need to have timezone of Mauritius for instance or Singapore, what would the function look like?

Thanking you in advance for your time.

Regards,
Darsh

1 ACCEPTED SOLUTION

@darshthakkar Can try this option- .toLocaleDateTimeString({“format”:“YYYY-MM-dd’T’HH:mm:ss z”,“timeZone”:“IST”}) will give you “2022-08-16T12:06:55 IST” format.

View solution in original post

5 REPLIES 5

Try the below expression:

Date.now().toLocaleDateTimeString({"timeZone":"Asia/Kolkata", "format":"yyyy-MM-dd HH:mm"})

Reference:

https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439344/Date+Functions+and+Properties#Date...

For the {"timeZone":"zoneValue"} option, you can use the Canonical ID value from Joda-Time.