java.time.Duration.minusDays() 方法示例 java.time.Duration.minus(long amountToSubtract, TemporalUnit unit) java.time.Duration.minusHours() 方法示例 java.time.Duration.minusDays() 方法示例 package com.codingdict; import java.time.Duration; public class DurationDemo { public static void main(String[] args) { Duration duration = Duration.ofDays(5); System.out.println(duration.getSeconds()); Duration duration1 = duration.minusDays(3); System.out.println(duration1.getSeconds()); } } java.time.Duration.minus(long amountToSubtract, TemporalUnit unit) java.time.Duration.minusHours() 方法示例