Java TimeZone getAvailableIDs() Example

TimeZone class getAvailableIDs() method example. This example shows you how to use getAvailableIDs() method.


Syntax is : public static String[] getAvailableIDs(int rawOffset)
This method returns available IDs according to the given time zone offset in milliseconds.

Here is the code.
/**
 * @(#) GetAvailableIDs1TimeZone.java
 * A class representing use of method getAvailableIDs() of TimeZone class in 
 java.util Package. This is an abstract class.
 * @Version  27-May-2008
 @author   Rose India Team
 */
import java.util.*;

class GetAvailableIDs1TimeZone {
    public static void mainString args[] ){
        
    // getAvailableIDs() method call. This is static method.
        String[] avaiId = TimeZone.getAvailableIDs(3600000);
    System.out.print("All the available IDs are for given offset :\n");
    for (int i=0; i<avaiId.length; i++)
    {
      System.out.print(avaiId[i", ");
    }       
  }
}

Output of the program.
All the available IDs are for given offset :
Africa/Algiers, Africa/Bangui, Africa/Brazzaville, Africa/Ceuta, Africa/Douala, Africa/Kinshasa, Africa/Lagos, Africa/Libreville, Africa/Luanda, Africa/Malabo, Africa/Ndjamena, Africa/Niamey, Africa/Porto-Novo, Africa/Tunis, Africa/Windhoek, Arctic/Longyearbyen, Atlantic/Jan_Mayen, CET, ECT, Etc/GMT-1, Europe/Amsterdam, Europe/Andorra, Europe/Belgrade, Europe/Berlin, Europe/Bratislava, Europe/Brussels, Europe/Budapest, Europe/Copenhagen, Europe/Gibraltar,Europe/Ljubljana, Europe/Luxembourg, Europe/Madrid, Europe/Malta, Europe/Monaco, Europe/Oslo, Europe/Paris, Europe/Podgorica,Europe/Prague, Europe/Rome, Europe/San_Marino, Europe/Sarajevo, Europe/Skopje, Europe/Stockholm, Europe/Tirane, Europe/Vaduz,Europe/Vatican, Europe/Vienna, Europe/Warsaw, Europe/Zagreb, Europe/Zurich, MET, Poland,

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US