I need to send date in yyy-mm-dd format. I am doing data driven from csv file, now the problem is, eveyrym i close the file the formatting goes away and the date has to be unique for every request i send.
How i can set date in unique formate for every run reading from csv or without or without csv
If you canβt save back over the CSV file with the desired format, then you will need to use a pre-request script to read the date column from the CSV file .
Then use moment to format the data to the desired format before saving it to an collection or environment variable so it can be used in the request.
Can u plz tell me the code for that. Have nt used moment before
Have you tried searching the forum, or the Postman Learning Centre?
The following is a basic example.
let moment = require('moment');
let currentDate = moment(new Date()).format("YYYY-MM-DD");
console.log(currentDate);
Thank you, exploring on the same