征求意见 日期判断
This commit is contained in:
+8
-4
@@ -19,9 +19,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -118,7 +116,13 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Time.compareTo(new Date()) >= 0) return "0";
|
Date date=new Date(); //取时间
|
||||||
|
Calendar calendar = new GregorianCalendar();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.add(calendar.DATE,-1); //把日期往后增加一天,整数 往后推,负数往前移动
|
||||||
|
date=calendar.getTime(); //这个时间就是日期往后推一天的结果
|
||||||
|
|
||||||
|
if (Time.compareTo(date) >= 0) return "0";
|
||||||
else {
|
else {
|
||||||
return "1";
|
return "1";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user