In my program, user can choose a time zone from a list of IDs that I get from TimeZone.getAvailableIDs(). This ID is stored in the DB and later I use ZoneId.of(String zoneId) to get the ZoneId Object.
But today while debugging I realized that some IDs generated by TimeZone.getAvailableIDs() are not recognized by ZoneId.of(String zoneId) and a "java.time.zone.ZoneRulesException" is thrown. For example ZoneId.of("EAT") throws an exception.
The ZoneId class itself can generate a list of zone IDs using ZoneId.getAvailableZoneIds(). this returns 599 Ids for me but TimeZone.getAvailableIDs() returns 627 IDs.
Can someone please explain the difference to me? Why am I getting 2 different lists of zone IDs?
I use Java 8.