//将日期格式转换为时间戳 String begin = vars.get("first"); String end = vars.get("last"); Date beginTime1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(begin); Date endTime1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(last); String beginTime = String.valueOf(beginTime1.getTime()); String endTime = String.valueOf(endTime1.getTime()); vars.put("beginTime",beginTime); vars.put("endTime",endTime);