Get availablve timezone ids
static String[] getAvailableIDs()
- Gets all the available IDs supported.
static String[] getAvailableIDs(int rawOffset)
- Gets the available IDs according to the given time zone offset in milliseconds.
import java.util.TimeZone;
public class Main {
public static void main(String[] args) {
String[] ids = TimeZone.getAvailableIDs();
for(String id: ids){
System.out.println(id);
}
}
}
The output:
Etc/GMT+12
Etc/GMT+11
MIT
Pacific/Apia
Pacific/Midway
Pacific/Niue
...
...
Pacific/Enderbury
Pacific/Tongatapu
Etc/GMT-14
Pacific/Kiritimati
Home
Java Book
Essential Classes
Java Book
Essential Classes
TimeZone:
- TimeZone class
- Create TimeZone
- Get availablve timezone ids
- Get display name for a timezone
- Get daylight saving
- Get timezone id