java中间带T时间设置

 

java.util.Calendar startTime = null;
java.util.Calendar endTime = null;

String taskTime = "2020-12-16T00:00:55+08:00";

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:SSSXXX");

Date date = sdf.parse(taskTime);
Calendar startCalendar = Calendar.getInstance();
startCalendar.setTime(date);

 

Date endDate =new java.util.Date();
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(endDate);
endTime = endCalendar;

 

上一篇:java static作用盘点


下一篇:Node.js 实时显示文件下载进度并支持取消下载