Java - Time

About

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

Let op: java/util/concurrent/TimeUnit. A TimeUnit does not maintain time information (just for thread concurrency) <wrap box>TimeUnit.SECONDS.sleep(100);</note>

Object

Example

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

Powered by ComboStrap