Created
June 11, 2021 07:05
-
-
Save dmikurube/2db80a42f1124bae721b19438c0c53ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.Method; | |
import java.util.Arrays; | |
import java.util.Locale; | |
public final class TimeZoneNames { | |
public static void main(final String[] args) throws Exception { | |
for (final String[] e : getZoneStrings()) { | |
System.out.println(String.join(", ", Arrays.asList(e))); | |
} | |
} | |
private static String[][] getZoneStrings() throws Exception { | |
final Class<?> clazz = Class.forName("sun.util.locale.provider.TimeZoneNameUtility"); | |
final Method method = clazz.getMethod("getZoneStrings", Locale.class); | |
final Object zoneStringsObject = method.invoke(null, Locale.ENGLISH); | |
return (String[][]) zoneStringsObject; | |
} | |
} |
Author
dmikurube
commented
Jun 11, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment