????1??????仯
new_time=text1.getText();//????????л???????
new_date=formatter_2.parse(new_time);//????????е????????????????
cal.setTime(new_date);
new_time_1=text2.getText();//????????л???????
new_date_1=formatter_2.parse(new_time_1);//????????е????????????????
cal_1.setTime(new_date_1);
long diff=new_date_1.getTime()-new_date.getTime();//???????
long days=diff/(1000*60*60*24);//????????
long hours=(diff-days*(1000*60*60*24))/(1000*60*60);//????С???
long minutes=(diff-days*(1000*60*60*24)-hours*(1000*60*60))/(1000*60);//?????????
cal.add(Calendar.DAY_OF_MONTH??(int) -days);
cal.add(Calendar.HOUR??(int) -hours);
cal.add(Calendar.MINUTE??(int) -minutes);
new_date=cal.getTime();
String test_time=formatter_2.format(new_date);
StringBuffer test_str=new StringBuffer().append(test_time);
test_time=test_str.toString();
text1.setText(test_time);
String first_time=text1.getText();
cal_1.add(Calendar.DAY_OF_MONTH??(int) -days);
cal_1.add(Calendar.HOUR??(int) -hours);
cal_1.add(Calendar.MINUTE??(int) -minutes);
new_date_1=cal_1.getTime();
String test_time_1=formatter_2.format(new_date_1);
StringBuffer test_str_1=new StringBuffer().append(test_time_1);
test_time_1=test_str_1.toString();
text2.setText(test_time_1);
String last_time_1=text2.getText();
????2?????仯
new_time=text1.getText();//????????л???????
new_date=formatter_2.parse(new_time);//????????е????????????????
cal.setTime(new_date);
new_time_1=text2.getText();//????????л???????
new_date_1=formatter_2.parse(new_time_1);//????????е????????????????
cal_1.setTime(new_date_1);
long diff=new_date_1.getTime()-new_date.getTime();//???????
long days=diff/(1000*60*60*24);//????????
long hours=(diff-days*(1000*60*60*24))/(1000*60*60);//????С???
long minutes=(diff-days*(1000*60*60*24)-hours*(1000*60*60))/(1000*60);//?????????
cal.add(Calendar.DAY_OF_MONTH??(int) +days);
cal.add(Calendar.HOUR??(int) +hours);
cal.add(Calendar.MINUTE??(int) +minutes);
new_date=cal.getTime();
String test_time=formatter_2.format(new_date);
StringBuffer test_str=new StringBuffer().append(test_time);
test_time=test_str.toString();
text1.setText(test_time);
String first_time=text1.getText();
cal_1.add(Calendar.DAY_OF_MONTH??(int) +days);
cal_1.add(Calendar.HOUR??(int) +hours);
cal_1.add(Calendar.MINUTE??(int) +minutes);
new_date_1=cal_1.getTime();
String test_time_1=formatter_2.format(new_date_1);
StringBuffer test_str_1=new StringBuffer().append(test_time_1);
test_time_1=test_str_1.toString();
text2.setText(test_time_1);
String last_time_1=text2.getText();