• 2022-06-08
    public static void main(String[] args) {// 获取表示当前时间的Calendar对象Calendar calendar = Calendar.getInstance();// 设置指定日期,将MONTH设为13calendar.set(Calendar.MONTH, 13);System.out.println(calendar.getTime());// 开启non-lenient模式____________________________;calendar.set(Calendar.MONTH, 13);System.out.println(calendar.getTime());}