I know that:
One main difference is the Local
part of LocalDateTime
. If you live in Germany and create a LocalDateTime
instance and someone else lives in USA and creates another instance at the very same moment (provided the clocks are properly set) - the value of those objects would actually be different. This does not apply to Instant
, which is calculated independently from time zone.
LocalDateTime
stores date and time without timezone, but it's initial value is timezone dependent. Instant
's is not.
Moreover, LocalDateTime
provides methods for manipulating date components like days, hours, months. An Instant
does not.
apart from the nanosecond precision advantage of Instant and the time-zone part of LocalDateTime
Both classes have the same precision. LocalDateTime
does not store timezone. Read javadocs thoroughly, because you may make a big mistake with such invalid assumptions: Instant and LocalDateTime.