有的接口要傳遞當前的日期或時間,可以用__time()函數獲取當前時間
${__time()} 當前時間到計算機元年的毫秒數
${__time(時間格式)} 以預定的格式顯示當前時間
請求示例:
__time(時間格式) 參數:(可以新建http請求,拷貝到parameters里面)
time ${__time()} text/plain false true YMD ${__time(YMD)} text/plain false true HMS ${__time(HMS)} text/plain false true YMDHMS ${__time(YMDHMS)} text/plain false true time1 ${__time(yyMMdd)} text/plain false true time2 ${__time(yyyy-MM-dd)} text/plain false true time3 ${__time(yyyy-MM-dd'T'HH:mm:ss.SSS)} text/plain false true
拷貝:
結果:
注意字母的大小寫:
H 24小時制的小時, h 12小時制的小時;S 毫秒,s秒;M 月份,m分鍾;D 一年的第幾天,d一個月的第幾天。