Duration ofHours(long hours)
creates
a Duration representing a number of standard hours.
ofHours
has the following syntax.
public static Duration ofHours(long hours)
The following example shows how to use ofHours
.
import java.time.Duration; public class Main { public static void main(String[] args) { Duration duration = Duration.ofHours(10); System.out.println(duration); } }
The code above generates the following result.