| | |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * localdate转为字符串 |
| | | * |
| | | * @param time localdate |
| | | * @return 字符串 |
| | | */ |
| | | public String localDateToString(LocalDate time) { |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | return df.format(time); |
| | | } |
| | | |
| | | /** |
| | | * localdatetime转为字符串 |
| | | * |
| | | * @param time localdatetime |
| | | * @return 字符串 |
| | | */ |
| | | public static String localDateTimeToStringHHmm(LocalDateTime time) { |
| | | DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); |
| | | return df.format(time); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取月初和月末日期 |