- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get the IDs according to the given time zone offset in Java
In order to get the IDs according to the given time zone offset in Java, we use the getAvailableIDs(int rawOffset) method. The java.util.TimeZone.getAvailableIDs(int rawOffset) method returns the available IDs according to the given time zone offset in the arguments.
Declaration − The java.util.TimeZone.getAvailableIDs(int rawOffset) method is declared as follows −
public static String[] getAvailableIDs(int rawOffset)
where rawOffset is the given time zone GMT offset.
Let us see a Java program which gets the IDs according to the given time zone offset −
Example
import java.util.*; public class Example { public static void main(String args[]) { // getting available supported ids for given offset String[] id = TimeZone.getAvailableIDs(36000000); // printing available ids for offset System.out.println("The available IDs are as follows:"); for (int i = 0; i< id.length; i++) { System.out.println(id[i]); } } }
Output
The available IDs are as follows: AET Antarctica/DumontDUrville Asia/Ust-Nera Asia/Vladivostok Australia/ACT Australia/Brisbane Australia/Canberra Australia/Currie Australia/Hobart Australia/Lindeman Australia/Melbourne Australia/NSW Australia/Queensland Australia/Sydney Australia/Tasmania Australia/Victoria Etc/GMT-10 Pacific/Chuuk Pacific/Guam Pacific/Port_Moresby Pacific/Saipan Pacific/Truk Pacific/Yap
- Related Articles
- Get all the IDs of the Time Zone in Java
- Set the base time zone offset to GMT in Java
- Get the default Time Zone in Java
- How to return the time-zone offset in minutes for the current locale?
- Python Pandas - Get the UTC Offset Time
- Java Program to display Current Time in another Time Zone
- How do I get the current time zone of MySQL?
- How to get Time in Milliseconds for the Given date and time in Java?
- Display time zone with SimpleDateFormat(“z”) in Java
- How to get current time zone in android using clock API class?
- mysql_tzinfo_to_sql - Load the Time Zone Tables in MySQL
- How to use time zone in a JSP?
- How to set time zone in a JSP?
- Colour the part according to the given fraction."
- How to get hour, minutes and seconds in android using offset time API class?

Advertisements