How can I add days to a date field?

How can I add days to a date field?

You can manipulate a date field by using the + (to add) and - (to subtract) Operators or by using the Built-in date functions. For example, if you would like to add 364 days to a particular date field, say StartDate and display it in another field, define a formula field named ExpiryDate with expression (StartDate + "52W:0D:0H:0M:0S") or by using the addDay built-in date function, StartDate.addDay(364).

For example,

form  Sample
{

StartDate
(
type = date
)


ExpiryDate
(
type = formula
value =
(StartDate + "52W:0D:0H:0M:0S")
)
}

where,

- W stands for the number of weeks.
-
D stands for the number of days.
- The other units of time supported are
H (hours), M (minutes) and S (seconds)

    • Related Articles

    • Date-field Autoresponder

      Understanding date-field autoresponder Date-field based autoresponders are a series of automated messages that are sent to contacts based on the date in the date field associated with them. Wishing customers happy birthdays and anniversaries are ...
    • How can I calculate the number of days between two date fields?

      To calculate the number of days between two given date fields, for instance, ServiceStartDate and ServiceEndDate, add a formula field to the form with formula expression as below. ((ServiceEndDate - ServiceStartDate) / (1000 * 60 * 60 * 24)) ,where ...
    • How do I Filter Views based on Date Criteria?

      Show records that expires in the next seven days You can use the following criteria in your view to fetch records ending in the next 7 days, based on the Expiry date in the form. In the sample code given below, Expiry is the name of the date field in ...
    • When will a date-field journey trigger?

      A date-field based journey will be triggered based on the date in the custom date-field associated with it.
    • When will a date-field autoresponder trigger?

      The messages in a date-field series will be triggered based on the date in the custom date-field associated with the autoresponder.