30 minutes before transfer method Java string time

Date sdate=null;
Calendar c = new GregorianCalendar();
c.setTime(tbScheduleDutyEntity.getStartDate());//设置参数时间
c.add(Calendar.MINUTE,-30);
 sdate=c.getTime();

 

NOTE: tbScheduleDutyEntity.getStartDate () type Date Date if the string please turn into type.

Guess you like

Origin www.cnblogs.com/baixiuhua/p/11646011.html