以北京时间为例,北京时区为东八区,对事件的首尾时间转为标准时区进行发送即可。
Calendar c_start = Calendar.getInstance();
c_start.setTime(startTime);
c_start.add(Calendar.HOUR, -8);
startTime = c_start.getTime();
Calendar c_end = Calendar.getInstance();
c_end.setTime(endTime);
c_end.add(Calendar.HOUR, -8);
endTime = c_end.getTime();
SimpleDateFormat sim = new SimpleDateFormat("yyyyMMdd'T'HHmmss");
SimpleDateFormat resultSim = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startStr = sim.format(resultSim.parse(DateUtil.getDateTimeStr(startTime)));
String endStr = sim.format(resultSim.parse(DateUtil.getDateTimeStr(endTime)));