Java 8
System.out.println(LocalDateTime.now().getHour());
System.out.println(LocalDateTime.now().getMinute());
System.out.println(LocalDateTime.now().getSecond());
日历
System.out.println(Calendar.getInstance().get(Calendar.HOUR_OF_DAY));
System.out.println(Calendar.getInstance().get(Calendar.MINUTE));
System.out.println(Calendar.getInstance().get(Calendar.SECOND));
乔达时间
System.out.println(new DateTime().getHourOfDay());
System.out.println(new DateTime().getMinuteOfHour());
System.out.println(new DateTime().getSecondOfMinute());
格式化的
Java 8
System.out.println(ZonedDateTime.now().format(DateTimeFormatter.ISO_LOCAL_TIME));
System.out.println(LocalTime.now().getHour() + ":" + LocalTime.now().getMinute() + ":" + LocalTime.now().getSecond());
System.out.println(new SimpleDateFormat("HH:mm:ss").format(Calendar.getInstance().getTime()));
System.out.println(new SimpleDateFormat("HHmmss").format(Calendar.getInstance().getTime()));
System.out.println(new Date().toString().substring(11, 20));