java.time.Duration.minusSeconds() 方法示例 java.time.Duration.minusNanos() 方法示例 java.time.Duration.multipliedBy() 方法示例 java.time.Duration.minusSeconds() 方法示例 package com.codingdict; import java.time.Duration; public class DurationDemo { public static void main(String[] args) { Duration duration = Duration.ofSeconds(5); System.out.println(duration.getSeconds()); Duration duration1 = duration.minusSeconds(3); System.out.println(duration1.getSeconds()); } } java.time.Duration.minusNanos() 方法示例 java.time.Duration.multipliedBy() 方法示例