Преобразование имени часового пояса в код зоны в Java ⇐ JAVA
-
Anonymous
Преобразование имени часового пояса в код зоны в Java
My program input is time zone name, as 'Asia/Singapore'.
I need to convert it to corresponding zone code, as SGT.
ZoneId class doesn't seem to have any method for it.
What is most convenient way of doing it?
PS: This works
TimeZone timeZone = TimeZone.getTimeZone("Asia/Singapore"); System.out.println(timeZone.getDisplayName(false, TimeZone.SHORT));
Источник: https://stackoverflow.com/questions/781 ... de-in-java
My program input is time zone name, as 'Asia/Singapore'.
I need to convert it to corresponding zone code, as SGT.
ZoneId class doesn't seem to have any method for it.
What is most convenient way of doing it?
PS: This works
TimeZone timeZone = TimeZone.getTimeZone("Asia/Singapore"); System.out.println(timeZone.getDisplayName(false, TimeZone.SHORT));
Источник: https://stackoverflow.com/questions/781 ... de-in-java
Мобильная версия