Postman使用Date数据类型:
在form-data数据类型下,使用 2021/7/7 11:11:00 (yyyy/MM/dd HH:mm:ss) 的数据格式即可
如下:
在json数据格式中,这种的则不能适用,需要在Per-request Script中设置参数然后使用,如下:
postman.setGlobalVariable("startTime",Date.parse(new Date("2021/06/01 00:00:10")));
postman.setGlobalVariable("endTime",Date.parse(new Date("2021/06/13 23:59:10")));
在raw的json body中使用
{
"startDate":"{{startTime}}",
"endDate":"{{endTime}}"
}
即可
如图: