I am trying to get the data from a period of time. They are set to actual dates but I wanted to know if it was possible to always have it set to today's date without having to go back and change it every time. query params
You can add the following in the "Pre-request Script" heading below the URL field.
postman.setGlobalVariable('currentDate', (new Date()).toISOString());
Then add the variable wherever you are wanting to use the current date
{{currentDate}}
For example passing the current date as a query param
www.example.com/path?date={{currentDate}}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With