A moment in time.
A point in time must be uniquely identified, so that it is independent of a time zone. For example,
1970-01-01, 00:00:00 does not represent a moment in time, since this would happen at different times in different time zones: someone in Tokyo would think its already
1970-01-01 several hours earlier than someone in Berlin would. To represent such entities, use LocalDateTime. In contrast, "the moment the clocks in London first showed 00:00 on Jan 1, 2000" is a specific moment in time, as is "1970-01-01, 00:00:00 UTC+0", and so it can be represented as an Instant.
Instant uses the UTC-SLS (smeared leap second) time scale. This time scale doesn't contain instants corresponding to leap seconds, but instead "smears" positive and negative leap seconds among the last 1000 seconds of the day when a leap second happens.
Some ways in which Instant can be acquired are:
Instant.parse parses an ISO-8601 string.
this instant with the other instant. Returns zero if this instant represents the same moment as the other (i.e. equal to other), a negative number if this instant is earlier than the other, and a positive number if this instant is later than the other.
Returns an instant that is the result of subtracting the specified duration from this instant.
Returns an instant that is the result of adding the specified duration to this instant.
Returns the number of milliseconds from the epoch instant
Converts this instant to the ISO-8601 string representation.
The number of seconds from the epoch instant
1970-01-01T00:00:00Z rounded down to a Long number.
The number of nanoseconds by which this instant is later than epochSeconds from the epoch instant.
Returns an instant that is the result of subtracting components of DateTimePeriod from this instant. The components are subtracted in the order from the largest units to the smallest, i.e. from years to nanoseconds.
Returns an instant that is the result of subtracting one unit from this instant.
Returns an instant that is the result of adding one unit to this instant.
Returns an instant that is the result of adding components of DateTimePeriod to this instant. The components are added in the order from the largest units to the smallest, i.e. from years to nanoseconds.
Returns a civil date/time value that this instant has in the specified timeZone.