| | |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | public static void main(String[] args) throws ParseException { |
| | | String date = "2021-08"; |
| | | System.out.println(getDate(date)); |
| | | } |
| | | |
| | | /** |
| | | * 方法名: getDate |
| | |
| | | public static boolean verifyRequestTime(long timestamp) { |
| | | long now = System.currentTimeMillis(); |
| | | long time = now - timestamp; |
| | | System.out.println(now); |
| | | System.out.println(time); |
| | | System.out.println(time / 1000); |
| | | // System.out.println(now); |
| | | // System.out.println(time); |
| | | // System.out.println(time / 1000); |
| | | if (time / 1000 > 60) { |
| | | return false; |
| | | } |
| | |
| | | if (c.get(Calendar.DAY_OF_WEEK) == 1) { |
| | | return date; |
| | | } |
| | | System.out.println(c.get(Calendar.DAY_OF_WEEK)); |
| | | // System.out.println(c.get(Calendar.DAY_OF_WEEK)); |
| | | c.add(Calendar.DATE, 7 - c.get(Calendar.DAY_OF_WEEK) + 1); |
| | | return c.getTime(); |
| | | } |