方法一:
var Date = new Date()
var year = Date.getFullYear() //2021
var month = Date.getMonth()+1 //6,月份是从0开始
var day = Date.getDate() //8
var deliverDay= Date.getDate()+2
console.log(year,month ,day )
pm.gloables.set("deliverDay",year+'/'+month +'/'+deliverDay)
方法二:
var moment = require(moment)
var date = moment().format("YYYY-MM-DD HH:mm:ss")
console.log(date )
pm.gloables.set("date",date)