java.time.Duration.minusMillis() 方法示例 java.time.Duration.minusHours() 方法示例 java.time.Duration.minusMinutes() 方法示例 java.time.Duration.minusMillis() 方法示例 package com.codingdict; import java.time.Duration; public class DurationDemo { public static void main(String[] args) { Duration duration = Duration.ofSeconds(5); Duration duration1 = duration.minusMillis(3); Duration duration2 = duration.minusMillis(4); System.out.println(duration1.getNano()); System.out.println(duration2.getNano()); } } java.time.Duration.minusHours() 方法示例 java.time.Duration.minusMinutes() 方法示例