Java Language Dates and Time (java.time.*) Instant


Example

Represents an instant in time. Can be thought of as a wrapper around a Unix timestamp.

Instant now = Instant.now();
Instant epoch1 = Instant.ofEpochMilli(0);
Instant epoch2 = Instant.parse("1970-01-01T00:00:00Z");
java.time.temporal.ChronoUnit.MICROS.between(epoch1, epoch2); // 0