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