0

I have a post .json method where I send an object:

{
"targetSigningDate": "2021-09-22T21:00:00.000Z"
}

The "targetSigningDate" must always be 'sysdate'. Instead of manualy chaning the date, how to set sysdate into the object using pre-req. script ?

Thank you in advance

Lexamenrf
  • 59
  • 1
  • 7

2 Answers2

0

JSON format does not expect a sysdate type value, so it won't be parsed as sysdate by parsers. You should do it programmatically yourself instead.

dswij
  • 148
  • 6
0

I've figured it out by creating a pre-request script where I set a variable 'moment' and then set it to the environment

looks like this:

{
    var moment = require('moment')
    pm.environment.set("sysdate", moment())
}
Lexamenrf
  • 59
  • 1
  • 7