Skip to main content

Adding the log below from the formatter

I am pulling the date from salesforce and formatting it to show the date correctly in a message to the customers. But in some cases, we are seeing the date being changed to the previous day.

-----

 

 

Request Information

Method:

POST

URL/Path:

https://transformer.zapier.com/transform

Expand 2 Headers

Params:

N/A

Duration (milliseconds):

23

Data:

{ "to_timezone": "US/Mountain", "from_timezone": "US/Mountain", "transform": "date.formatting", "inputs": "2024-08-07T00:00:00Z", "to_format": "MMM DD YYYY", "from_format": "YYYY-MM-DDTHH🇲🇲ssZ" }

Response Information

Status code:

200

Expand 3 Headers

URL/Path:

https://transformer.zapier.com/transform

Content:

{ "outputs": "Aug 06 2024" }

Hi @danbbm 

Many systems operate on UTC time.

Check if the timestamp returned from Salesforce is in UTC time.

If so, then the From Time Zone would need to be set to UTC in the Formatter step.


Hi @danbbm 

Many systems operate on UTC time.

Check if the timestamp returned from Salesforce is in UTC time.

If so, then the From Time Zone would need to be set to UTC in the Formatter step.

Thanks Troy.

 

What is the best way to confirm if the timestamp is in UTC? Also what if I do not want any conversion done. Just the date to be formatted? That is the reason I set both to MST.


@danbbm 

If you just want to take the Timestamp and convert the Date Format then try this

 

2024-08-07T00:00:00Z

 

Action: Formatter > Text > Split

Split at T

Keep the first Segment

That will give you a date as: YYYY-MM-DD

 

Action: Formatter > Date & Time > Format

Specify the desired Date Format: MMM DD YYYY

Use the same Time Zone for To/From

 

If you need more help, for us to have true context, post screenshots with how your Zap steps are outlined and configured in EDIT mode.


I changed both the from and to timezone to UTC and the date seems to stay the same. Would this work?

 

 

 


Here are the steps, 

 

 


@danbbm 

Would this work?

When in doubt, test it out.

 

If you just want to take the Timestamp and convert the Date Format then try this

 

2024-08-07T00:00:00Z

 

Action: Formatter > Text > Split

Split at T

Keep the first Segment

That will give you a date as: YYYY-MM-DD

 

Action: Formatter > Date & Time > Format

Specify the desired Date Format: MMM DD YYYY

Use the same Time Zone for To/From


Reply