梵蒂冈之花
您正在混合使用新旧 API。TimeZone.getAvailableIDs()返回可以解析的时区 ID TimeZone.getTimeZone(String ID)。ZoneId.getAvailableZoneIds()返回可以解析的区域 ID ZoneId.of(String zoneId)。如果比较 2 的结果,您会看到:public static void main(String[] args) { Set<String> timeZones = Set.of(TimeZone.getAvailableIDs()); Set<String> zoneIds = ZoneId.getAvailableZoneIds(); System.out.println("Extra TimeZone's: " + diff(timeZones, zoneIds)); System.out.println("Extra ZoneId's: " + diff(zoneIds, timeZones));}static Set<String> diff(Set<String> a, Set<String> b) { Set<String> diff = new TreeSet<>(a); diff.removeAll(b); return diff;}输出 (jdk-11.0.1)Extra TimeZone's: [ACT, AET, AGT, ART, AST, BET, BST, CAT, CNT, CST, CTT, EAT, ECT, EST, HST, IET, IST, JST, MIT, MST, NET, NST, PLT, PNT, PRT, PST, SST, VST]Extra ZoneId's: []如您所见,ZoneId.getAvailableZoneIds()并不声称支持EST,只是TimeZone.getAvailableIDs()支持。