It has separate types for
• LocalTime (milliseconds after midnight)
• LocalDate (julian day),
• LocalDateTime (julian day and milliseconds after midnight),
• Instant (nanoseconds since EPOCH),
• ZonedDateTime (which is a point in time with a timezone, and exposes both the localdatetime and the instant APIs)
All of these types have a reason to exist, and definitely shouldn't be mixed together (like python does).
• If I program an alarm clock, I'll want to use LocalTime. Even if DST starts/ends, you still wanna get woken up at 8am.
• My birthday is a LocalDate. It usually has no time information, and usually isn't depending on a timezone. An anniversary is the same.
• The moment when a loggable event happened is an Instant. The event doesn't care about timezones, only the exact time it happened.
• A calendar event is a ZonedDateTime: the meeting will happen at 10am CET, regardless of which timezone I'm in at that point.
All these types describe different concepts, and they shouldn't be mixed together. Every language should adopt JSR310. Yes, it's relatively complicated, but it's extremely precise and accurate.
And you can convert them all!
•LocalDate + LocalTime becomes LocalDateTime
• LocalDateTime.atZone(ZoneId or ZoneOffset) becomes ZonedDateTime
• Instant.atZone(ZoneId or ZoneOffset) becomes ZonedDateTime
• ZonedDateTime.toInstant() or ZonedDateTime.toLocalDateTime() exposes local datetime and instant.
• LocalDate can easilybe converted to JapaneseDate, HebrewDate, ArabicDate.