โ08-15-2022 11:28 AM
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
Solved! Go to Solution.
โ08-15-2022 11:38 PM
@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.
โ08-15-2022 01:24 PM
$Expire_Date.toLocaleDateTimeString({format: "yyyy-MM-dd'T'hh:mm:ss'EST'"})
โ08-15-2022 11:38 PM
@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.
โ02-28-2023 06:59 AM
Thank you @Supratim, I was able to test this out and it worked!
โ03-12-2024 02:23 AM
Hi @Supratim ,
Can you please help me on this.
I have tried as mentioned
Date.now().toLocaleDateTimeString({โformatโ:โYYYY-MM-dd'T'HH:mm:ss zโ,โtimeZoneโ:โISTโ})
which is giving me in UTC as below
_snaptype_datetime:"2024-03-12T09:15:05.038 UTC"