方法一:
Date date = new Date();
int hours = date.getHours();
方法二:
GregorianCalendar calendar = new GregorianCalendar();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
System.out.println("hour=" + hour);
方法一:
Date date = new Date();
int hours = date.getHours();
GregorianCalendar calendar = new GregorianCalendar();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
System.out.println("hour=" + hour);