Home » Duration

Tag Archives: Duration

Java 8 Period and Duration Example

In this article we will learn about the Duration and Period classes in Java. These classes were added in Java 8. 1. Introduction A Duration measures an amount of time using time-based values (seconds, nanoseconds). A Period uses date-based values (years, months, days). Duration public final class Duration extends Object implements TemporalAmount, Comparable<Duration>, Serializable   A Duration represents a time-based ...

Read More »

Java 8 Date and Time API Tutorial

JDK 1.0 had java.util.Date class giving access to Java’s first Date API. However soon after its usage, it started to show cracks of problems on its brittle surface. It did not take any longer to realize that java.util.Date was not thread-safe!                   Table Of Contents 1 . Introduction 2. The new Date ...

Read More »