时间转秒越界
时间不加 L
就会越界
long l = 90L * 24 * 60 * 60 * 1000;
System.out.println(l);
固定时间格式化
Date curTime = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm");
// 19:30
System.out.println(simpleDateFormat.format(curTime));
Date parse = simpleDateFormat.parse("18:00");
// Thu Jan 01 18:00:00 CST 1970
System.out.println(parse);
// 18:00
System.out.println(simpleDateFormat.format(parse));