java.time.Duration.get() 方法示例 java.time.Duration.from() 方法示例 java.time.Duration.getNano() 方法示例 java.time.Duration.get() 方法示例 package com.codingdict; import java.time.Duration; import java.time.LocalTime; import java.time.temporal.ChronoUnit; public class DurationDemo { public static void main(String[] args) { Duration duration = Duration.between(LocalTime.NOON,LocalTime.MAX); System.out.println(duration.get(ChronoUnit.SECONDS)); } } java.time.Duration.from() 方法示例 java.time.Duration.getNano() 方法示例