springboot DateUtil获取本周,本年,本月开始结束时间

约定不等于承诺〃 2023-10-04 22:27 122阅读 0赞
  1. package com.bandweaver.tunnel.common.platform.util;
  2. import java.sql.Timestamp;
  3. import java.text.DateFormat;
  4. import java.text.ParsePosition;
  5. import java.text.SimpleDateFormat;
  6. import java.util.ArrayList;
  7. import java.util.Calendar;
  8. import java.util.Date;
  9. import java.util.GregorianCalendar;
  10. import java.util.HashMap;
  11. import java.util.List;
  12. import java.util.Map;
  13. import com.bandweaver.tunnel.common.biz.constant.TimeEnum;
  14. public class DateUtil {
  15. public static Date getCurrentDate() {
  16. return new Date();
  17. }
  18. /**
  19. * 获取当天的开始时间
  20. */
  21. public static Date getDayBegin() {
  22. Calendar cal = new GregorianCalendar();
  23. cal.set(Calendar.HOUR_OF_DAY, 0);
  24. cal.set(Calendar.MINUTE, 0);
  25. cal.set(Calendar.SECOND, 0);
  26. cal.set(Calendar.MILLISECOND, 0);
  27. return cal.getTime();
  28. }
  29. /**
  30. * 获取当天的结束时间
  31. * @return
  32. */
  33. public static Date getDayEnd() {
  34. Calendar cal = new GregorianCalendar();
  35. cal.set(Calendar.HOUR_OF_DAY, 23);
  36. cal.set(Calendar.MINUTE, 59);
  37. cal.set(Calendar.SECOND, 59);
  38. return cal.getTime();
  39. }
  40. /**
  41. * 获取昨天的开始时间
  42. * @return
  43. */
  44. public static Date getBeginDayOfYesterday() {
  45. Calendar cal = new GregorianCalendar();
  46. cal.setTime(getDayBegin());
  47. cal.add(Calendar.DAY_OF_MONTH, -1);
  48. return cal.getTime();
  49. }
  50. /**
  51. * 获取昨天的结束时间
  52. * @return
  53. */
  54. public static Date getEndDayOfYesterDay() {
  55. Calendar cal = new GregorianCalendar();
  56. cal.setTime(getDayEnd());
  57. cal.add(Calendar.DAY_OF_MONTH, -1);
  58. return cal.getTime();
  59. }
  60. /**
  61. * 获取明天的开始时间
  62. * @return
  63. */
  64. public static Date getBeginDayOfTomorrow() {
  65. Calendar cal = new GregorianCalendar();
  66. cal.setTime(getDayBegin());
  67. cal.add(Calendar.DAY_OF_MONTH, 1);
  68. return cal.getTime();
  69. }
  70. //获取明天的结束时间
  71. public static Date getEndDayOfTomorrow() {
  72. Calendar cal = new GregorianCalendar();
  73. cal.setTime(getDayEnd());
  74. cal.add(Calendar.DAY_OF_MONTH, 1);
  75. return cal.getTime();
  76. }
  77. /**
  78. * 获取本周的开始时间
  79. * @return
  80. */
  81. public static Date getBeginDayOfWeek() {
  82. Date date = new Date();
  83. return getBeginDayOfWeek(date);
  84. }
  85. /**
  86. * 获取本周的开始时间
  87. * @return
  88. */
  89. public static Date getBeginDayOfWeek(Date date) {
  90. if (date == null) {
  91. return null;
  92. }
  93. Calendar cal = Calendar.getInstance();
  94. cal.setTime(date);
  95. int dayofweek = cal.get(Calendar.DAY_OF_WEEK);
  96. if (dayofweek == 1) {
  97. dayofweek += 7;
  98. }
  99. cal.add(Calendar.DATE, 2 - dayofweek);
  100. return getDayStartTime(cal.getTime());
  101. }
  102. /**
  103. * 获取本周的结束时间
  104. * @return
  105. */
  106. public static Date getEndDayOfWeek(){
  107. Calendar cal = Calendar.getInstance();
  108. cal.setTime(getBeginDayOfWeek());
  109. cal.add(Calendar.DAY_OF_WEEK, 6);
  110. Date weekEndSta = cal.getTime();
  111. return getDayEndTime(weekEndSta);
  112. }
  113. /**获取本周的结束时间
  114. * @param date
  115. * @return
  116. * @author shaosen
  117. * @Date 2018年9月12日
  118. */
  119. public static Date getEndDayOfWeek(Date date){
  120. Calendar cal = Calendar.getInstance();
  121. cal.setTime(getBeginDayOfWeek(date));
  122. cal.add(Calendar.DAY_OF_WEEK, 6);
  123. Date weekEndSta = cal.getTime();
  124. return getDayEndTime(weekEndSta);
  125. }
  126. /**
  127. * 获取本月的开始时间
  128. * @return
  129. */
  130. public static Date getBeginDayOfMonth() {
  131. Calendar calendar = Calendar.getInstance();
  132. calendar.set(getNowYear(), getNowMonth() - 1, 1);
  133. return getDayStartTime(calendar.getTime());
  134. }
  135. /**
  136. * 获取本月的开始时间
  137. * @return
  138. */
  139. public static Date getBeginDayOfMonth(Date time){
  140. Calendar calendar = Calendar.getInstance();
  141. calendar.setTime(time);
  142. calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) , 1);
  143. return getDayStartTime(calendar.getTime());
  144. }
  145. /**
  146. * 获取本月的结束时间
  147. * @return
  148. */
  149. public static Date getEndDayOfMonth() {
  150. Calendar calendar = Calendar.getInstance();
  151. calendar.set(getNowYear(), getNowMonth() - 1, 1);
  152. int day = calendar.getActualMaximum(5);
  153. calendar.set(getNowYear(), getNowMonth() - 1, day);
  154. return getDayEndTime(calendar.getTime());
  155. }
  156. /**
  157. * 获取本月的结束时间
  158. * @return
  159. */
  160. public static Date getEndDayOfMonth(Date time) {
  161. Calendar calendar = Calendar.getInstance();
  162. calendar.setTime(time);
  163. calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) , 1);
  164. int day = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
  165. calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) , day);
  166. return getDayEndTime(calendar.getTime());
  167. }
  168. /**
  169. * 获取本年的开始时间
  170. * @return
  171. */
  172. public static Date getBeginDayOfYear() {
  173. return getBeginDayOfYear(new Date());
  174. }
  175. /**
  176. * 获得time所在年的第一天
  177. * @param time
  178. * @return
  179. */
  180. public static Date getBeginDayOfYear(Date time){
  181. Calendar cal = Calendar.getInstance();
  182. cal.setTime(time);
  183. cal.set(Calendar.YEAR, cal.get(Calendar.YEAR));
  184. cal.set(Calendar.MONTH, Calendar.JANUARY);
  185. cal.set(Calendar.DATE, 1);
  186. return getDayStartTime(cal.getTime());
  187. }
  188. /**
  189. * 获取本年的结束时间
  190. * @return
  191. */
  192. public static Date getEndDayOfYear() {
  193. return getEndDayOfYear(new Date());
  194. }
  195. /**
  196. * 获取本年的结束时间
  197. * @return
  198. */
  199. public static Date getEndDayOfYear(Date time) {
  200. Calendar cal = Calendar.getInstance();
  201. cal.setTime(time);
  202. cal.set(Calendar.YEAR, cal.get(Calendar.YEAR));
  203. cal.set(Calendar.MONTH, Calendar.DECEMBER);
  204. cal.set(Calendar.DATE, 31);
  205. return getDayEndTime(cal.getTime());
  206. }
  207. /**
  208. * 获取某个日期的开始时间
  209. * @param d
  210. * @return
  211. */
  212. public static Date getDayStartTime(Date d) {
  213. Calendar calendar = Calendar.getInstance();
  214. if(null != d) calendar.setTime(d);
  215. calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH),calendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
  216. calendar.set(Calendar.MILLISECOND, 0);
  217. // return new Timestamp(calendar.getTimeInMillis());
  218. return calendar.getTime();
  219. }
  220. /**
  221. * 获取某个日期的结束时间
  222. * @param d
  223. * @return
  224. */
  225. public static Date getDayEndTime(Date d) {
  226. Calendar calendar = Calendar.getInstance();
  227. if(null != d) calendar.setTime(d);
  228. calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), 23, 59, 59);
  229. calendar.set(Calendar.MILLISECOND, 999);
  230. // return new Timestamp(calendar.getTimeInMillis());
  231. return calendar.getTime();
  232. }
  233. /**
  234. * 获取今年是哪一年
  235. * @return
  236. */
  237. public static Integer getNowYear() {
  238. Date date = new Date();
  239. return getNowYear(date);
  240. }
  241. /**
  242. * 获取今年是哪一年
  243. * @return
  244. */
  245. public static Integer getNowYear(Date date) {
  246. GregorianCalendar gc = (GregorianCalendar) Calendar.getInstance();
  247. gc.setTime(date);
  248. return Integer.valueOf(gc.get(1));
  249. }
  250. /**
  251. * 获取本月是哪一月
  252. * @return
  253. */
  254. public static int getNowMonth() {
  255. Date date = new Date();
  256. return getNowMonth(date);
  257. }
  258. /**
  259. * 获取本月是哪一月
  260. * @return
  261. */
  262. public static int getNowMonth(Date date) {
  263. GregorianCalendar gc = (GregorianCalendar) Calendar.getInstance();
  264. gc.setTime(date);
  265. return gc.get(2) + 1;
  266. }
  267. /**
  268. * @Description: 获取当日是第几周
  269. * @param @param date
  270. * @param @return
  271. * @return int
  272. * @throws
  273. * @author shaosen
  274. * @date 2018年6月1日
  275. */
  276. public static int getNowWeek(Date date) {
  277. Calendar ca = Calendar.getInstance();
  278. ca.setTime(date);
  279. return ca.get(Calendar.WEEK_OF_YEAR);
  280. }
  281. /**
  282. * 两个日期相减得到的天数
  283. * @param beginDate
  284. * @param endDate
  285. * @return
  286. */
  287. public static int getDiffDays(Date beginDate, Date endDate) {
  288. if (beginDate == null || endDate == null) {
  289. throw new IllegalArgumentException("getDiffDays param is null!");
  290. }
  291. long diff = (endDate.getTime() - beginDate.getTime())
  292. / (1000 * 60 * 60 * 24);
  293. int days = new Long(diff).intValue();
  294. return days;
  295. }
  296. /**
  297. * @Description: 获取两个日期的时间差
  298. * @param @param beginDate
  299. * @param @param endDate
  300. * @return long
  301. * @throws
  302. * @author shaosen
  303. * @date 2018年6月13日
  304. */
  305. public static long getDiffHours(Date beginDate, Date endDate) {
  306. long between = dateDiff(beginDate, endDate);
  307. long day = between / (24 * 60 * 60 * 1000);
  308. long hours = (between / (60 * 60 * 1000) - day * 24);
  309. return day*24+hours;
  310. }
  311. /**
  312. * 两个日期相减得到的毫秒数
  313. * @param beginDate
  314. * @param endDate
  315. * @return
  316. */
  317. public static long dateDiff(Date beginDate, Date endDate) {
  318. long date1ms = beginDate.getTime();
  319. long date2ms = endDate.getTime();
  320. return date2ms - date1ms;
  321. }
  322. /**
  323. * 获取两个日期中的最大日期
  324. * @param beginDate
  325. * @param endDate
  326. * @return
  327. */
  328. public static Date max(Date beginDate, Date endDate) {
  329. if (beginDate == null) {
  330. return endDate;
  331. }
  332. if (endDate == null) {
  333. return beginDate;
  334. }
  335. if (beginDate.after(endDate)) {
  336. return beginDate;
  337. }
  338. return endDate;
  339. }
  340. /**
  341. * 获取两个日期中的最小日期
  342. * @param beginDate
  343. * @param endDate
  344. * @return
  345. */
  346. public static Date min(Date beginDate, Date endDate) {
  347. if (beginDate == null) {
  348. return endDate;
  349. }
  350. if (endDate == null) {
  351. return beginDate;
  352. }
  353. if (beginDate.after(endDate)) {
  354. return endDate;
  355. }
  356. return beginDate;
  357. }
  358. /**
  359. * 返回某月该季度的第一个月
  360. * @param date
  361. * @return
  362. */
  363. public static Date getFirstSeasonDate(Date date) {
  364. final int[] SEASON = { 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4 };
  365. Calendar cal = Calendar.getInstance();
  366. cal.setTime(date);
  367. int sean = SEASON[cal.get(Calendar.MONTH)];
  368. cal.set(Calendar.MONTH, sean * 3 - 3);
  369. return cal.getTime();
  370. }
  371. /**
  372. * 返回某个日期下几天的日期
  373. * @param date
  374. * @param i
  375. * @return
  376. */
  377. public static Date getNextDay(Date date, int i) {
  378. Calendar cal = new GregorianCalendar();
  379. cal.setTime(date);
  380. cal.set(Calendar.DATE, cal.get(Calendar.DATE) + i);
  381. return cal.getTime();
  382. }
  383. /**
  384. * 返回某个日期前几天的日期
  385. * @param date
  386. * @param i
  387. * @return
  388. */
  389. public static Date getFrontDay(Date date, int i) {
  390. Calendar cal = new GregorianCalendar();
  391. cal.setTime(date);
  392. cal.set(Calendar.DATE, cal.get(Calendar.DATE) - i);
  393. return cal.getTime();
  394. }
  395. /**
  396. * 获取某年某月到某年某月按天的切片日期集合(间隔天数的日期集合)
  397. * @param beginYear
  398. * @param beginMonth
  399. * @param endYear
  400. * @param endMonth
  401. * @param k
  402. * @return
  403. */
  404. public static List getTimeList(int beginYear, int beginMonth, int endYear,
  405. int endMonth, int k) {
  406. List list = new ArrayList();
  407. if (beginYear == endYear) {
  408. for (int j = beginMonth; j <= endMonth; j++) {
  409. list.add(getTimeList(beginYear, j, k));
  410. }
  411. } else {
  412. {
  413. for (int j = beginMonth; j < 12; j++) {
  414. list.add(getTimeList(beginYear, j, k));
  415. }
  416. for (int i = beginYear + 1; i < endYear; i++) {
  417. for (int j = 0; j < 12; j++) {
  418. list.add(getTimeList(i, j, k));
  419. }
  420. }
  421. for (int j = 0; j <= endMonth; j++) {
  422. list.add(getTimeList(endYear, j, k));
  423. }
  424. }
  425. }
  426. return list;
  427. }
  428. /**
  429. * 获取某年某月按天切片日期集合(某个月间隔多少天的日期集合)
  430. * @param beginYear
  431. * @param beginMonth
  432. * @param k
  433. * @return
  434. */
  435. public static List getTimeList(int beginYear, int beginMonth, int k) {
  436. List list = new ArrayList();
  437. Calendar begincal = new GregorianCalendar(beginYear, beginMonth, 1);
  438. int max = begincal.getActualMaximum(Calendar.DATE);
  439. for (int i = 1; i < max; i = i + k) {
  440. list.add(begincal.getTime());
  441. begincal.add(Calendar.DATE, k);
  442. }
  443. begincal = new GregorianCalendar(beginYear, beginMonth, max);
  444. list.add(begincal.getTime());
  445. return list;
  446. }
  447. /**
  448. * 将精确到s的时间戳转化为时间
  449. * @param t
  450. * @return
  451. */
  452. public static Date setTimestamp2Date(long t){
  453. return new Date(t * 1000);
  454. }
  455. /**
  456. * 将精确到毫秒的时间戳转化为时间
  457. * @param t
  458. * @return
  459. */
  460. public static Date setMillisTimestamp2Date(long t){
  461. return new Date(t);
  462. }
  463. /**
  464. * 将时间转化为s的时间戳
  465. * @param d
  466. * @return
  467. */
  468. public static Long setDate2Timestamp(Date d){
  469. return d.getTime() / 1000;
  470. }
  471. /**
  472. * 将时间转化为毫秒为单位的时间戳
  473. * @param d
  474. * @return
  475. */
  476. public static Long setDate2MillisTimestamp(Date d){
  477. return d.getTime();
  478. }
  479. /**
  480. * string格式转Date yyyy-MM-dd HH:mm:ss
  481. * @param s
  482. * @return
  483. */
  484. public static Date getString2Date(String s){
  485. if(s==null||s.trim().length()<0) {
  486. return null;
  487. }
  488. DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  489. ParsePosition pos = new ParsePosition(0);
  490. return formatter.parse(s, pos);
  491. }
  492. /**
  493. * 将时间转化为string格式 yyyy-MM-dd HH:mm:ss
  494. * @param d
  495. * @return
  496. */
  497. public static String getDate2String(Date d){
  498. DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  499. return formatter.format(d);
  500. }
  501. public static String getDate2YYYYMMdd(Date d){
  502. DateFormat formatter = new SimpleDateFormat("yyyyMMdd");
  503. return formatter.format(d);
  504. }
  505. /**获取前n个小时的时间
  506. * @param date
  507. * @param hour
  508. * @return
  509. * @author shaosen
  510. * @Date 2018年9月12日
  511. */
  512. public static Date getBeforHour(Date date , int hour) {
  513. Calendar c = Calendar.getInstance();
  514. c.setTime(date);
  515. c.set(Calendar.HOUR_OF_DAY, c.get(Calendar.HOUR_OF_DAY) - hour );
  516. return c.getTime();
  517. }
  518. /**获取后n个小时的时间
  519. * @param date
  520. * @param hour
  521. * @return
  522. * @author shaosen
  523. * @Date 2018年9月12日
  524. */
  525. public static Date getAfterHour(Date date , int hour) {
  526. Calendar c = Calendar.getInstance();
  527. c.setTime(date);
  528. c.set(Calendar.HOUR_OF_DAY, c.get(Calendar.HOUR_OF_DAY) + hour );
  529. return c.getTime();
  530. }
  531. /**获取小时开始时间
  532. * @param date
  533. * @return
  534. * @author shaosen
  535. * @Date 2018年9月12日
  536. */
  537. public static Date getHourBeginTime(Date date) {
  538. Calendar c = Calendar.getInstance();
  539. c.setTime(date);
  540. c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH), c.get(Calendar.HOUR_OF_DAY), 0, 0);
  541. c.set(Calendar.MILLISECOND, 0);
  542. return c.getTime();
  543. }
  544. /**获取小时结束时间
  545. * @param date
  546. * @return
  547. * @author shaosen
  548. * @Date 2018年9月12日
  549. */
  550. public static Date getHourEndTime(Date date) {
  551. Calendar c = Calendar.getInstance();
  552. c.setTime(date);
  553. c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH), c.get(Calendar.HOUR_OF_DAY), 59, 59);
  554. c.set(Calendar.MILLISECOND, 999);
  555. return c.getTime();
  556. }
  557. /**按照周期分别查找
  558. * @param em TimeEnum枚举
  559. * @return
  560. * @author shaosen
  561. * @Date 2018年11月6日
  562. */
  563. public static List<Map<String, Date>> getStartTimeAndEndTimeByIntervalvalue(TimeEnum em) {
  564. List<Map<String, Date>> list = new ArrayList<>();
  565. if (em == TimeEnum.WEEK) {
  566. Date beginDayOfWeek = DateUtil.getBeginDayOfWeek();// 获取本周的开始时间
  567. Map<String, Date> map = new HashMap<>();
  568. map.put("startDay", beginDayOfWeek);
  569. map.put("endDay", new Date());
  570. list.add(map);
  571. list = getStartTimeAndEndTimeByWeek(beginDayOfWeek, list);
  572. } else if (em == TimeEnum.MONTH) {
  573. Date beginDayOfMonth = DateUtil.getBeginDayOfMonth();
  574. Map<String, Date> map = new HashMap<>();
  575. map.put("startDay", beginDayOfMonth);
  576. map.put("endDay", new Date());
  577. list.add(map);
  578. list = getStartTimeAndEndTimeByMonth(beginDayOfMonth, list);
  579. } else if (em == TimeEnum.DAY) {
  580. Date dayBegin = DateUtil.getDayBegin();
  581. Map<String, Date> map = new HashMap<>();
  582. map.put("startDay", dayBegin);
  583. map.put("endDay", new Date());
  584. list.add(map);
  585. list = getStartTimeAndEndTimeByDay(dayBegin, list);
  586. }
  587. return list;
  588. }
  589. private static List<Map<String, Date>> getStartTimeAndEndTimeByDay(Date date, List<Map<String, Date>> list) {
  590. Date endDay = DateUtil.getFrontDay(date, 1);// 返回某个日期前几天的日期
  591. Date startDay = DateUtil.getDayStartTime(endDay);
  592. if (startDay.after(DateUtil.getBeginDayOfYear())) {
  593. Map<String, Date> map = new HashMap<>();
  594. map.put("startDay", startDay);
  595. map.put("endDay", date);
  596. list.add(map);
  597. getStartTimeAndEndTimeByDay(startDay, list);
  598. } else {
  599. Map<String, Date> lastMap = new HashMap<>();
  600. lastMap.put("startDay", DateUtil.getBeginDayOfYear());
  601. lastMap.put("endDay", date);
  602. list.add(lastMap);
  603. }
  604. return list;
  605. }
  606. private static List<Map<String, Date>> getStartTimeAndEndTimeByMonth(Date date, List<Map<String, Date>> list) {
  607. Date endDay = DateUtil.getFrontDay(date, 1);// 返回某个日期前几天的日期
  608. Date startDay = DateUtil.getBeginDayOfMonth(endDay);
  609. if (startDay.after(DateUtil.getBeginDayOfYear())) {
  610. Map<String, Date> map = new HashMap<>();
  611. map.put("startDay", startDay);
  612. map.put("endDay", date);
  613. list.add(map);
  614. // 继续找上月开始时间和结束时间
  615. getStartTimeAndEndTimeByMonth(startDay, list);
  616. }
  617. return list;
  618. }
  619. private static List<Map<String, Date>> getStartTimeAndEndTimeByWeek(Date date, List<Map<String, Date>> list) {
  620. Date endDay = DateUtil.getFrontDay(date, 1);// 返回某个日期前几天的日期
  621. Date startDay = DateUtil.getBeginDayOfWeek(endDay);
  622. if (startDay.after(DateUtil.getBeginDayOfYear())) {
  623. Map<String, Date> map = new HashMap<>();
  624. map.put("startDay", startDay);
  625. map.put("endDay", date);
  626. list.add(map);
  627. // 继续找上周开始时间和结束时间
  628. getStartTimeAndEndTimeByWeek(startDay, list);
  629. } else {
  630. // 获取本年第一周开始日期和结束日期
  631. Map<String, Date> lastMap = new HashMap<>();
  632. lastMap.put("startDay", DateUtil.getBeginDayOfYear());
  633. lastMap.put("endDay", date);
  634. list.add(lastMap);
  635. }
  636. return list;
  637. }
  638. /**获取当月以前共12个月的日期集合
  639. * @author shaosen
  640. * @date 2019年1月17日
  641. * @param
  642. * @return List<Map<String,Date>>
  643. */
  644. public static List<Map<String, Date>> getBefore12Months(){
  645. List<Map<String, Date>> list = new ArrayList<>();
  646. Date startDay = DateUtil.getBeginDayOfMonth();
  647. Map<String, Date> map = new HashMap<>();
  648. map.put("startDay", startDay);
  649. map.put("endDay", new Date());
  650. list.add(map);
  651. for (int i = 1; i < 12; i++) {
  652. startDay = DateUtil.getBeginDayOfMonth(DateUtil.getFrontDay(startDay, 1));
  653. Map<String, Date> m = new HashMap<>();
  654. m.put("startDay", startDay);
  655. m.put("endDay", DateUtil.getEndDayOfMonth(startDay));
  656. list.add(m);
  657. }
  658. return list;
  659. }
  660. public static void main(String[] args) {
  661. List<Map<String, Date>> list = getBefore12Months();
  662. for (Map<String, Date> map : list) {
  663. System.out.println(map.get("startDay"));
  664. System.out.println(map.get("endDay"));
  665. System.out.println("--------------------");
  666. }
  667. }
  668. }

发表评论

表情:
评论列表 (有 0 条评论,122人围观)

还没有评论,来说两句吧...

相关阅读