public static void main(String[] args) {
Calendar calendar = Calendar.getInstance(Locale.getDefault());
System.out.println(calendar.get(Calendar.YEAR));
System.out.println(calendar.get(Calendar.MONTH)+1);
System.out.println(calendar.get(Calendar.DATE));
}
3行代码分别用于获取当前时间的年、月绝樱、日,获取月份的时候烂滑需要+1,因为月份取的索引饥宏腊值,从0-11