How to use pre-script to add days on current date with HTTP Synthetic?

Hello .

can someone help on this item please ?

i want to add few days on the  api.date() value to have a future date.

but i seems more complicate that i thought

is that possible ?

i tried many things but still not working .this is my last code i tried :

var numberOfDaysToAdd = 10;

api.setValue(“DateNow”,api.dateToFormat(api.date(), “yyyy-MM-dd”));

var CurrentDate = new date();

DepartureDate = CurrentDate.setDate(api.getValue(DateNow) + numberOfDaysToAdd);

thanks for your help and feedback

Have you tried the snippet here? You could modify it to be suitable for an HTTP Monitor.
There’s some great how to guides for Synthetic in the Synthetic Troubleshooting Map

Thanks a lot .

it’s good start it will help for sure