Is there a reason for java.time.ZoneId not including an Enum of ZoneIds?
问题 To get a ZoneId it goes like: ZoneId.of("America/Sao_Paulo"); or ZoneId.of(ZoneId.SHORT_IDS.get("BET")); Why would be the reason for not existing an Enum of such values, like: ZoneId.of(ZoneIds.AMERICA_SAO_PAULO); which seems less error-prone and a lot more auto-complete friendly? 回答1: I believe it's because the list of all possible timezones names can change regardless of Java version. Timezone information comes with Java installation (usually in the folder <java-home>/lib/zi , or in jre/lib