Skip to content

Tag Archives: Java-Duration

Duration is the value-based Class present in the Java time library. It’s used to get time-based amount of time. This class is immutable and thread-safe.… Read More
The equals(Duration) method of Duration Class in java.time package is used to check whether this duration is equal to the duration passed as the parameter.… Read More
The toHours() method of Duration Class in java.time package is used get the value of this duration in number of hours. Syntax: public long toHours()… Read More
The ofSeconds(long, long) method of Duration Class in java.time package is used to get a duration in a 1 second format. In this method, the… Read More
The toHoursPart() method of Duration Class in java.time package is used get the value of this duration in number of hours by dividing the number… Read More
The get(TemporalUnit) method of Duration Class in java.time package is used to get the value of the unit passed as the parameter. Only units SECONDS… Read More
The toString() method of Duration Class in java.time package is used to get the String value of this duration. This String is in the ISO-8601… Read More
The toMinutes() method of Duration Class in java.time package is used get the value of this duration in number of minutes. Syntax: public long toMinutes()… Read More
The between(Temporal) method of Duration Class in java.time package is used to get a Duration in between the two Temporal objects passed as the parameter.… Read More
The ofNanos(long) method of Duration Class in java.time package is used to get a duration in a 1 nanoSecond format. Syntax: public static Duration ofNanos(long… Read More
The toDaysPart() method of Duration Class in java.time package is used get the value of this duration in number of days by dividing the number… Read More
The hashCode() method of Duration Class in java.time package is used to get the hashCode value of this duration. Syntax: public int hashCode() Parameters: This… Read More
The toMinutesPart() method of Duration Class in java.time package is used get the value of this duration in number of minutes by dividing the number… Read More
The ofMillis(long) method of Duration Class in java.time package is used to get a duration in a 1 milliSecond format. Syntax: public static Duration ofMillis(long… Read More
The minusMinutes(long) method of Duration Class in java.time package is used to get an immutable copy of this duration with the specified number of minutes… Read More