Java Date Time - Duration ofMinutes(long minutes) example








Duration ofMinutes(long minutes) creates a Duration representing a number of standard minutes.

Syntax

ofMinutes has the following syntax.

public static Duration ofMinutes(long minutes)

Example

The following example shows how to use ofMinutes.

import java.time.Duration;

public class Main {
  public static void main(String[] args) {
    Duration duration = Duration.ofMinutes(10);
    System.out.println(duration);
  }
}

The code above generates the following result.