Hi,
I need to have the current date and timestamp generated in my prescript to derive a control key, also need to use the same date and timestamp in the GET request Params.
I have tried this
var moment = require(‘moment’)
pm.environment.set(‘timestamp’, moment().format((“YYYY-MM-DDTHH:MM:SS”)));
But this is the time i see generated always
2021-09-20T14:09:68
2021-09-20T14:09:76
2021-09-20T14:09:83
2021-09-20T14:09:66
2021-09-20T14:09:80
However my current time is 2021-09-20T14:41:00
Can you please help me with generating current time in the format “YYYY-MM-DDTHH:MM:SS-HH:MM” or “YYYY-MM-DDTHH:MM:SS”?