Duration toMinutes()
gets the number of minutes in this duration.
This returns the total number of minutes in the duration by dividing the number of seconds by 60.
toMinutes
has the following syntax.
public long toMinutes()
The following example shows how to use toMinutes
.
import java.time.Duration; import java.time.LocalTime; /*from ww w .ja v a 2 s .co m*/ public class Main { public static void main(String[] args) { Duration duration = Duration.between(LocalTime.MIDNIGHT,LocalTime.NOON); System.out.println(duration.toMinutes()); } }
The code above generates the following result.