Example usage for java.util TimeZone getAvailableIDs

List of usage examples for java.util TimeZone getAvailableIDs

Introduction

In this page you can find the example usage for java.util TimeZone getAvailableIDs.

Prototype

public static synchronized String[] getAvailableIDs() 

Source Link

Document

Gets all the available IDs supported.

Usage

From source file:MainClass.java

public static void main(String[] a) {
    String[] ids = TimeZone.getAvailableIDs();
    for (String id : ids) {
        System.out.println(id);/*www  .  jav a  2  s  .com*/
    }
}

From source file:Main.java

public static void main(String[] args) {
    String[] ids = TimeZone.getAvailableIDs();
    for (String id : ids) {
        System.out.println(id);//from  w  ww.  j  ava  2s .  com
    }

}

From source file:Main.java

public static void main(String[] args) {
    String[] ids = TimeZone.getAvailableIDs();

    for (String id : ids) {
        int slash = id.indexOf('/');
        String stripped = id.substring(slash + 1).replace("_", " ");
        System.out.println(stripped);
    }//from   ww w. java2 s  .com
}

From source file:Main.java

public static void main(String[] args) {
    String[] availableTimezones = TimeZone.getAvailableIDs();

    for (String timezone : availableTimezones) {
        System.out.println("Timezone ID = " + timezone);
    }/*from ww  w .  j  a  v a 2  s.com*/
}

From source file:KVMTimeZones.java

public static void main(String[] args) {
    TimeZone defaultTZ = TimeZone.getDefault();
    String[] ids = TimeZone.getAvailableIDs();

    System.out.println("Available time zone ids: ");
    for (int i = 0; i < ids.length; i++) {
        System.out.print(ids[i] + " ");
    }//w w  w.  j  a  va2s .  c o m
    System.out.println(
            "\nDefault timezone is " + defaultTZ.getID() + ", GMT offset = " + defaultTZ.getRawOffset());
}

From source file:Main.java

public static void main(String[] args) {
    String[] allTimeZones = TimeZone.getAvailableIDs();

    Arrays.sort(allTimeZones);/*from  w w  w  .j a v a  2 s . c  o m*/

    for (String timezone : allTimeZones) {
        System.out.println(timezone);
    }
}

From source file:Main.java

public static String[] fecthAllTimeZoneIds() {
    Vector<String> v = new Vector<String>();
    String[] ids = TimeZone.getAvailableIDs();
    for (int i = 0; i < ids.length; i++) {
        v.add(ids[i]);//from   w  ww. j av  a 2s  .co m
    }
    java.util.Collections.sort(v, String.CASE_INSENSITIVE_ORDER);
    v.copyInto(ids);
    v = null;
    return ids;
}

From source file:com.loadtesting.showcase.springmvc.model.converter.FastTimeConverter.java

public FastTimeConverter(String pattern) {
    int length = TimeZone.getAvailableIDs().length;
    this.map = new ConcurrentHashMap<TimeZone, FastDateFormat>(length);
    this.pattern = pattern;
}

From source file:org.eclipse.gyrex.admin.ui.jobs.internal.TimeZoneProposals.java

@Override
public IContentProposal[] getProposals(final String contents, final int position) {
    final List<IContentProposal> resultList = new ArrayList<IContentProposal>();

    final String patternString = StringUtils.trimToNull(StringUtils.substring(contents, 0, position));

    final String[] availableIDs = TimeZone.getAvailableIDs();
    Arrays.sort(availableIDs);//from w w w .ja  v a2  s  . c  o m
    for (final String id : availableIDs) {
        final TimeZone timeZone = TimeZone.getTimeZone(id);
        if ((null == patternString) || StringUtils.contains(StringUtils.lowerCase(timeZone.getID()),
                StringUtils.lowerCase(patternString))) {
            resultList.add(
                    new ContentProposal(timeZone.getID(), id + " - " + timeZone.getDisplayName(Locale.US)));
        }
    }

    return resultList.toArray(new IContentProposal[resultList.size()]);
}

From source file:org.shredzone.cilla.admin.TimeZoneBean.java

@PostConstruct
public void setup() {
    for (String id : TimeZone.getAvailableIDs()) {
        TimeZone tz = TimeZone.getTimeZone(id);
        timeZoneMap.put(id, tz);/* w  w w  .  ja va2 s  . c o  m*/
        timeZoneMap.put(tz.getDisplayName(Locale.ENGLISH).toLowerCase(), tz);
    }
}