当前位置: 技术问答>java相关
这样 得到 系统的 当前年, 月 ,日?100相送!
来源: 互联网 发布时间:2015-06-13
本文导语: 这样 得到 系统的 当前年, 月 ,日?100相送! | Calendar calendar = new GregorianCalendar(); System.out.println("YEAR: " calendar.get(Calendar.YEAR)); System.out.println("MONTH: " calendar.get(Calendar.MONTH)); ...
这样 得到 系统的 当前年, 月 ,日?100相送!
|
Calendar calendar = new GregorianCalendar();
System.out.println("YEAR: " calendar.get(Calendar.YEAR));
System.out.println("MONTH: " calendar.get(Calendar.MONTH));
System.out.println("WEEK_OF_YEAR: " calendar.get(Calendar.WEEK_OF_YEAR));
System.out.println("WEEK_OF_MONTH: " calendar.get(Calendar.WEEK_OF_MONTH));
System.out.println("DATE: " calendar.get(Calendar.DATE));
System.out.println("DAY_OF_MONTH: " calendar.get(Calendar.DAY_OF_MONTH));
System.out.println("DAY_OF_YEAR: " calendar.get(Calendar.DAY_OF_YEAR));
System.out.println("DAY_OF_WEEK: " calendar.get(Calendar.DAY_OF_WEEK));
System.out.println("DAY_OF_WEEK_IN_MONTH: "
calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH));
System.out.println("AM_PM: " calendar.get(Calendar.AM_PM));
System.out.println("HOUR: " calendar.get(Calendar.HOUR));
System.out.println("HOUR_OF_DAY: " calendar.get(Calendar.HOUR_OF_DAY));
System.out.println("MINUTE: " calendar.get(Calendar.MINUTE));
System.out.println("SECOND: " calendar.get(Calendar.SECOND));
System.out.println("MILLISECOND: " calendar.get(Calendar.MILLISECOND));
啊Ctrl-C+Ctrl-V的感觉真好
System.out.println("YEAR: " calendar.get(Calendar.YEAR));
System.out.println("MONTH: " calendar.get(Calendar.MONTH));
System.out.println("WEEK_OF_YEAR: " calendar.get(Calendar.WEEK_OF_YEAR));
System.out.println("WEEK_OF_MONTH: " calendar.get(Calendar.WEEK_OF_MONTH));
System.out.println("DATE: " calendar.get(Calendar.DATE));
System.out.println("DAY_OF_MONTH: " calendar.get(Calendar.DAY_OF_MONTH));
System.out.println("DAY_OF_YEAR: " calendar.get(Calendar.DAY_OF_YEAR));
System.out.println("DAY_OF_WEEK: " calendar.get(Calendar.DAY_OF_WEEK));
System.out.println("DAY_OF_WEEK_IN_MONTH: "
calendar.get(Calendar.DAY_OF_WEEK_IN_MONTH));
System.out.println("AM_PM: " calendar.get(Calendar.AM_PM));
System.out.println("HOUR: " calendar.get(Calendar.HOUR));
System.out.println("HOUR_OF_DAY: " calendar.get(Calendar.HOUR_OF_DAY));
System.out.println("MINUTE: " calendar.get(Calendar.MINUTE));
System.out.println("SECOND: " calendar.get(Calendar.SECOND));
System.out.println("MILLISECOND: " calendar.get(Calendar.MILLISECOND));
啊Ctrl-C+Ctrl-V的感觉真好