LocalDateTime.now() has different levels of precision on Windows and Mac machine
问题 When creating a new LocalDateTime using LocalDateTime.now() on my Mac and Windows machine i get a nano precision of 6 on my Mac and a nano precision of 3 on my Windows machine. Both are running jdk-1.8.0-172 . Is it possible to limit or increase the precision on one of the machines? And why is the precision actually different? 回答1: The precision is different because LocalDateTime.now() uses a system default Clock. Obtains the current date-time from the system clock in the default time-zone.