How do I find the time zone with the abbreviated name "HNEC"?

My android app uses this code to get the short name of the timezone the phone is in.

String shortDisplayName = Calendar.getInstance().getTimeZone().getDisplayName(false, TimeZone.SHORT);

      

For my user in Strasbourg, France , shortDisplayName

this is "HNEC" (I haven't yet found out which region to play in). I'm trying to figure out exactly which TimeZone this short name has. So I put together some quick test codes:

String[] ids = TimeZone.getAvailableIDs();
Locale[] locales = Locale.getAvailableLocales();
for (String id : ids) {
    TimeZone timeZone = TimeZone.getTimeZone(id);
    int rawOffset = timeZone.getRawOffset();
    for (Locale locale : locales) {
        String shortDisplayName = timeZone.getDisplayName(false, TimeZone.SHORT, locale);
        if (shortDisplayName.equalsIgnoreCase("HNEC")) {
            System.out.println(id + " | " + shortDisplayName + " | " + rawOffset);
        }
    }
}

      

When I run this code, no lines are printed. That is, no time slots using any language resolve the short name "HNEC"? How can I tell which TimeZone has the short name "HNEC"?

+2


a source to share





All Articles