java to get the hour of the current time

java to get the hour of the current time

GregorianCalendar calendar = new GregorianCalendar();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
System.out.println("hour=" + hour);

 

Guess you like

Origin blog.csdn.net/weixin_43442778/article/details/113200985