For following code for java 8
1. System.out.println(LocalDateTime.now(Clock.systemDefaultZone()));
2. System.out.println(Instant.now(Clock.systemDefaultZone()));
Line 1 print current time by adding offset but line 2 print current time without adding offset.
I checked the source code of both and found that LocaDateTime.now(clock)
return clock.instant()
return time by adding offset but Instant.now(clock)
not doing so.
Why it designed like this? Aren't we expecting same result in both case?