Skip to content

Date function

This function is used to fetch the date, depending upon the parameters given. For example : ${__date(Adjustment days,”Date format”)}, here adjustment days is a parameter. Like “0” represents the current date, if you want a future date you can change this parameter to any positive value and in case you want any past date you can change the parameter to a negative value, depending upon your requirement.

Syntax: ${__date(0,”MM/dd/yyyy”)}

Edit parameter section and click on Form, select functions from the dropdown and select Date function. Enter Days to add and Date format and click on save icon.

In the above snapshot, a local variable is set with value as current date.

After saving this step, step will look as below where a local variable output is assigned with current date.

Example: ${__date(0,”dd/MM/yyyy”)} ==> 16/09/2018 [current date]

Example: ${__date(10,”dd/MM/yyyy”)} ==> 26/09/2018 [current date + 10 days]

Link for date format Description : https://www.npmjs.com/package/dateformat.

Once variable is assigned with date in the given format you can use it in your further steps.

Back To Top