java.time.LocalTime.get() 方法示例 java.time.LocalTime.from() 方法示例 java.time.LocalTime.getHour() 方法示例 java.time.LocalTime.get() 方法示例 package com.codingdict; import java.time.LocalTime; import java.time.temporal.ChronoField; public class LocalTimeDemo { public static void main(String[] args) { LocalTime time = LocalTime.parse("12:30:30"); System.out.println(time.get(ChronoField.CLOCK_HOUR_OF_DAY)); } } java.time.LocalTime.from() 方法示例 java.time.LocalTime.getHour() 方法示例