Table of Contents

About

Java.time package supplants the old java.util.Date/Calendar classes.

Let op: javase/9/docs/api/java/util/concurrent/TimeUnit.html. A TimeUnit does not maintain time information (just for thread concurrency)

TimeUnit.SECONDS.sleep(100);

Object

Example

  • Build an instant
Instant.parse("2016-05-02T14:53:27Z")
  • Diff between two date time in millisecond
ChronoUnit.MILLIS.between(startTime, endTime);