How to do math for date? -->Add/reduce days from a date field

Options

Hello, dear team:
I wondered how to use action to do date math.
For example: I want to get a new date field from 10/15/2020 by adding 90 days.
In the support page: https://help.catalytic.com/docs/field-field-formulas/
It mentioned a formula:
Maximum date value, adding days
result =,new Date(Math.max(new Date(''), new Date('')) + '' * 86400000).toISOString();
Is the formula suitable for such calculation?
How can I put my value in the formula?
Field1 = 10/15/2020
Field2 = 90
Thank you.

Best Answer

  • Brandon_189578
    Brandon_189578 Posts: 36
    Answer ✓
    Options

    Ye,

    The first step is to get the date as a date field. If you do not already have a date field with the value you wish to manipulate, then use Date-times: Get current date & time or Dates: Set value of a date field.

    Once you have a date value in a date field, use Date-times: Adjust a date & time to add 90 days by setting Adjustment amount to 90 and Units to Days.

    This approach will be much less error-prone than manipulating dates in a formula, since date-time manipulation logic can be very difficult and error-prone.

    Regards,
    Brandon