| | |
| | | * Created by wuxw on 2017/7/24. |
| | | */ |
| | | public class DateUtil { |
| | | public static final String DATE_FORMATE_STRING_MILLI = "yyyyMMddHHmmssSSS"; // 17位:年月日时分秒毫秒 |
| | | |
| | | private static DateFormat dateFormat = new SimpleDateFormat("yyyyMMddhhmmss"); |
| | | |
| | | public static final String LAST_TIME = "2050-01-01 00:00:00"; |
| | | |
| | | public static int getTotalDaysInMonth(int year, int month) { |
| | | LocalDate date = LocalDate.of(year, month, 1); // 创建一个日期对象,年份和月份为指定值,日期为1号 |
| | | return date.lengthOfMonth(); // 返回该月的天数 |
| | | } |
| | | |
| | | private static Map<String, SimpleDateFormat> formats = new HashMap(); |
| | | public static final String DATE_FORMATE_STRING_DEFAULT = "yyyyMMddHHmmss"; |
| | | public static final String DATE_FORMATE_STRING_A = "yyyy-MM-dd HH:mm:ss"; |