What is a Java Duration?

Java Conceptuel Diagram

About

A java duration is an duration (ie interval) between two times.

How to get a duration in minutes?

Instant instant1 = ...
Instant instant2 = Instant.now();
Duration duration = Duration.between(instant1, instant2);
long minutes = duration.toMinutes();







Share this page:
Follow us:
Task Runner