Check format date with Postman

@mld1954 Welcome to the community :partying_face:

Please refer the similar post discussed here.

Something like below would work too:

var jsonData = pm.response.json();
console.log(jsonData.data)

let date = jsonData.data;

let moment = require ('moment');

pm.test("Checking data format", function () {
    pm.expect(date).to.include(moment(date).format('YYYY-MM-DD'));
});
2 Likes