[DONE] Calculation time does not match with time on date field

I encountered an issue with a calculation to generate titles automatically. Here it is:

As you can see, it is a very straightforward calculation. However, the time/hour does not match the calculation field. In the example below, the Date field says 16:00 (4:00 PM), but the title says 08:00.

Also, there is another issue that is not showing the @All of Company Name in the title.

What am I doing wrong?

Hi, I am fairly sure the time is a timezone thing where Automations work in UTC, Check out:
Date, Time & Timezone | Tape Developers (tapeapp.com)
The name one I’m afraid I can’t get my head around right now, sorry

2 Likes

Thanks for the feedback, @Jason. It pointed me in the right direction to fix the time mismatch. Here is the solution I used in the calculation field:

moment(@Date).tz("America/New_York").format("MM/DD/YY HH:mm")

For anyone else, you can find timezone references for Moment.js here.

As for the name not showing, I found the issue, which is that I have two relations from two apps (Leads and Clients), but in the calculation, I was referring to only one of the related apps. The solution was simply adding both @All of Lead Name + @All of Client Name to the formula. Now the formula looks like this:

@Appointment Type + " appt with " + @All of Lead Name + @All of Client Name + " on " + moment(@Date).tz("America/New_York").format("MM/DD/YY HH:mm")

Hope this helps the Tape community.

1 Like

@Luis that’s great news, pleased you got it working.

4 Likes

You can use the date_fns library instead of moment.

3 Likes