September 2018
Intermediate to advanced
802 pages
19h 30m
English
The java.time.Instant class stores the time information in its two fields:
When you invoke the now() method, java.time.Instant uses the system clock in UTC to represent that time instant. And then we can use atZone() or atOffset() to convert it into the required time zone, as we will see in the next section.
Use this class if you want to just represent the timeline of actions in UTC; that way, the timestamp stored for different events will be based on UTC and you can then convert it into your required time zone as and when required.
Read now
Unlock full access