java.time.Duration.dividedBy() 方法示例 java.time.Duration.compareTo() 方法示例 java.time.Duration.equals() 方法示例 java.time.Duration.dividedBy() 方法示例 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); Duration duration1 = duration.dividedBy(2); System.out.println(duration.getSeconds()); System.out.println(duration1.getSeconds()); } } java.time.Duration.compareTo() 方法示例 java.time.Duration.equals() 方法示例