bug
This commit is contained in:
+19
@@ -109,6 +109,25 @@ public class DateUtilCustom {
|
||||
return add(date,Calendar.DATE,amount);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取指定日期昨天的时间范围
|
||||
* @return
|
||||
*/
|
||||
public static Map<String, String> getYesterday(int addDay) {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
DateTime dt = new DateTime();
|
||||
// 昨天
|
||||
DateTime yesterday = dt.minusDays(addDay);
|
||||
String start = yesterday.toString("yyyy-MM-dd") + " 00:00:00";
|
||||
|
||||
DateTime day = dt.minusDays(addDay-1);
|
||||
String end = day.toString("yyyy-MM-dd") + " 00:00:00";
|
||||
map.put("start", start);
|
||||
map.put("end", end);
|
||||
return map;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.err.println(JsonUtils.toJson(getLatelyDate(3)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user