package org.kodejava.util;
import java.util.TimeZone;
public class TimezonesExample {
public static void main(String[] args) {
String[] availableTimezones = TimeZone.getAvailableIDs();
for (String timezone : availableTimezones) {
System.out.println("Timezone ID = " + timezone);
}
}
}
Some examples of the returned timezones ids are:
Timezone ID = Etc/GMT+12
Timezone ID = Etc/GMT+11
Timezone ID = MIT
Timezone ID = Pacific/Apia
Timezone ID = Pacific/Midway
Timezone ID = Pacific/Niue
Timezone ID = Pacific/Pago_Pago
Timezone ID = Pacific/Samoa
Timezone ID = US/Samoa
...
Latest posts by Wayan (see all)
- How do I get number of each day for a certain month in Java? - September 8, 2024
- How do I get operating system process information using ProcessHandle? - July 22, 2024
- How do I sum a BigDecimal property of a list of objects using Java Stream API? - July 22, 2024