计算两个时间相差30天。
String statime = starttime.getText();
String endtim = endtime.getText();
if(!"".equals(statime)&&!"".equals(endtim)){
long startLong = stringToDate(statime).getTime();
long endLong= stringToDate(endtim).getTime();
int a = (int) ((endLong-startLong)/(24 * 60 * 60 * 1000));
if(a>=31){
MessageDialog.openConfirm(getShell(), "提示", "两者之间的期限应控制在1个月内");
return;
}
}