Java 8, why not the ZonedTime class?

I found that Java 8 does not have the equivalent of ZonedDateTime , but to work only with Time (ZonedTime class or something like that). I know they included the OffsetTime class, but it only saves the offset.

Saving time zones along with date and time, and not just saving the offset, helps make daylight saving easier.

I do not ask you to give me alternatives, I know that there are many approaches; I'm just wondering why such a class was not included, is it a design problem? or did they just find it redundant?

+7
date timezone datetime time java-8
source share
1 answer

Introducing the ZonedTime class, which consists of LocalTime , and the time zone (instead of just LocalTime ) will be a big mistake.

The proposed type does not contain a date. But without a date, it will not be possible to estimate the real-time offset to display local time at any reasonable global time. To account for any aspect of daylight saving time, you must have a date and time.

+11
source share

All Articles