Catchpoint allows you to add formatted dates into Transaction scripts using the TimeTrim() and Time() macros. These macros return the current date formatted according to the parameters provided.
If you want to return another time relative to the current time, you can use the sub() and add() submacros to subtract or add time to the current time, respectivey. Both submacros take time values of days, months, or years and adds them accordingly. The number of time units should be prefixed with the time unit. Days are denoted with d, months are denoted with mo, and years are denoted with y. In Decimal Time, hours are denoted with h, minutes are denoted with mi, seconds are denoted with ss and milliseconds are denoted with msc.
Example 1:
//Create Variables to save dates
var addMonth= ${TimeTrim(MM/DD/YYYY,sub(mo63))};
var dayAdd= ${TimeTrim(MM/DD/YYYY,add(d7))};
var addYear = ${Time(MM/DD/YYYY,add(y7))};
//Use variables to open google page to verify.
//"Treat 40X or 50X HTTP Response as successful test run" should be enabled
open("google.com/${var(addMonth)}")
open("google.com/${var(addYear)}")
open("google.com/${var(dayAdd)}")
Example 2:
//Get a time that is ten minutes ago in a specific format (you may use time or timeTrim to change the format by including or excluding time values).
| Format | Command |
| YYYY/MM/DD/HH:MI | ${TimeTrim('YYYY/MM/DD/HH:MI',sub(mi10))} |
| HH:MI | ${Time('HH:MI',sub(mi10))} |