import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
try{
Date date =new Date(); //获取当前时间
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
String nowDate = sf.format(date);
Calendar cal = Calendar.getInstance();
cal.setTime(sf.parse(nowDate));
cal.add(Calendar.DAY_OF_YEAR,-1);
String orderDate = sf.format(cal.getTime());
vars.put("orderDate",orderDate);
cal.add(Calendar.DAY_OF_YEAR,-6);
String senderDate = sf.format(cal.getTime());
vars.put("senderDate",senderDate);
}
catch(Exception e){
}
Jmeter获取当前时间进行时间段加减操作
最新推荐文章于 2024-08-03 15:03:34 发布