java.time.Duration.from() 方法示例


java.time.Duration.from() 方法示例

package com.codingdict;

import java.time.Duration;
import java.time.temporal.ChronoUnit;

public class DurationDemo {
   public static void main(String[] args) {

      Duration duration = Duration.from(ChronoUnit.DAYS.getDuration());
      System.out.println(duration.toMinutes());
   }
}