Right now, we have an all-encompassing class TimeZone and its subclass, FixedOffsetTimeZone: TimeZone.
TimeZone can be an interface instead, with two separate implementations: FixedOffsetTimeZone and RegionTimeZone. We could split the time zones by what identifier they have:
- IANA tzdb identifiers, like
Etc/UTC or Europe/Berlin,
- and generic identifiers like
GMT+01:30.
An upside is that a RegionTimeZone would always have a valid IANA timezone database identifier, guaranteed to be recognized everywhere: see #222. A downside is that Etc/UTC is also semantically a fixed-offset time zone, but wouldn't be marked as such. Also, something like Etc/UTC is not even a region, so maybe another name is needed.
Right now, we have an all-encompassing
class TimeZoneand its subclass,FixedOffsetTimeZone: TimeZone.TimeZonecan be an interface instead, with two separate implementations:FixedOffsetTimeZoneandRegionTimeZone. We could split the time zones by what identifier they have:Etc/UTCorEurope/Berlin,GMT+01:30.An upside is that a
RegionTimeZonewould always have a valid IANA timezone database identifier, guaranteed to be recognized everywhere: see #222. A downside is thatEtc/UTCis also semantically a fixed-offset time zone, but wouldn't be marked as such. Also, something likeEtc/UTCis not even a region, so maybe another name is needed.