标签:
1.添加BeanShell PreProcessor
2.编辑脚本
import java.text.SimpleDateFormat;
import java.util.Date;
Date date = new Date();
Date date1 = new Date();
date.setDate(date.getDate()+2);
SimpleDateFormat df = new SimpleDateFormat("YYYY-MM-dd");
// or: SimpleDateFormat df = new SimpleDateFormat("MM-dd-yyyy");
String formattedDate = df.format(date);
String formattedDate1 = df.format(date1);
vars.put("Co",formattedDate);
vars.put("Ci",formattedDate1);
标签:
原文地址:http://www.cnblogs.com/Flander/p/5545280.html