I am trying to make an API call in Postman where I have to pass DateStart and DateEnd parameters. The date should be in the format yyyy-mm-ddThh:mm:ss. I tried the below but won't it just subtract 1 day from the current timestamp.
var moment = require('moment')
pm.environment.set("current_timestamp", moment().toISOString())
pm.environment.set("current_timestamp - 1 day", moment().subtract(1, 'day').toISOString())
Say for eg, if I make the API call today and want to retrieve the data for 'yesterday', then the date start variable should have a value of 2021-04-05T00:00:00 and date end variable should be 2021-04-06T00:00:00. The time should always be 00:00:00. How do I achieve this?
Thanks, Gowri