Table of Contents

Formulas - Date

Sofia Teran Updated by Sofia Teran

If is your first time with Formulas, please check our Getting Started guide here and our crash course here

Formulas available

  • AddDays
  • AddMonths
  • AddYears
  • Now
  • Today
  • ToDate

AddDays

Add 3 days to the specified date 2020/01/01

AddDays(@my_date,3)

AddMonths

Add 4 months to the specified date 2020/01/01
AddMonths(@my_date,4)

AddYears

Add 2 years to the specified date 2020/01/01
AddDaysAddYears(@my_date,2)

Now

Get the current timestamp (date and hours) for a specific TimeZone

CheckΒ this linkΒ to see the supported values (TZ database name column).

Now("Africa/Abidjan")

Get Date (YYYY-MM-DD format) and Time (in HH:MM:ss)

GetValue(Split(Now("Europe/Madrid"),"."),0)

Get Date in YYYY-MM-DD

GetValue(Split(GetValue(Split(Now("Europe/Madrid"),"."),0)," "),0)
Get Time in HH:MM:ss

GetValue(Split(GetValue(Split(Now("Europe/Madrid"),"."),0)," "),1)

Get Date in DD-MM-YYYY format

In this case, we need to extract and store every element separately and join them after with a Set Variable block:

To get the variable @day:

GetValue(Split(GetValue(Split(GetValue(Split(Now("Europe/Madrid"),"."),0)," "),0),"-"),2)

To get the variable @month:

GetValue(Split(GetValue(Split(GetValue(Split(Now("Europe/Madrid"),"."),0)," "),0),"-"),1)

To get the variable @year:

GetValue(Split(GetValue(Split(GetValue(Split(Now("Europe/Madrid"),"."),0)," "),0),"-"),0)

And finally joining those variable using a Set Variable block:

Get Date (DD-MM-YYYY format) and Time (in HH:MM:ss)

If you want to add the time also, will be the same path as before (Get Date (DD-MM-YYYY format) , but this time we will add a fourth formula, and add it to the Set Variable block

GetValue(Split(GetValue(Split(Now("Europe/Madrid"),"."),0)," "),1)

And the Set Variable block:

Today

Get current date
Today()

ToDate

Convert date to a format like this 2020-12-20

ToDate(@dates,"%Y-%m-%d")

How did we do?

Formulas - Array

Formulas - Object

Contact