Example usage for org.joda.time DateTimeZone getShortName

List of usage examples for org.joda.time DateTimeZone getShortName

Introduction

In this page you can find the example usage for org.joda.time DateTimeZone getShortName.

Prototype

public final String getShortName(long instant) 

Source Link

Document

Gets the short name of this datetime zone suitable for display using the default locale.

Usage

From source file:org.thelq.pircbotx.commands.NewYearsCommand.java

License:Open Source License

protected static String getExtendedNames(Collection<DateTimeZone> tzList) {
    if (tzList.isEmpty())
        return null;
    //Prebuild long form of timezones
    long nowTime = System.currentTimeMillis();
    Set<String> tzExtendedSet = Sets.newHashSet();
    for (DateTimeZone curTz : tzList) {
        if (StringUtils.startsWithIgnoreCase(curTz.getID(), "Etc/"))
            continue;
        tzExtendedSet.add(curTz.getName(nowTime) + "(" + curTz.getShortName(nowTime) + ")");
    }/*from www.ja  v a2 s  . co m*/
    return StringUtils.defaultIfBlank(StringUtils.join(tzExtendedSet, ", "), null);
}

From source file:org.thelq.pircbotx.commands.NewYearsCommand.java

License:Open Source License

protected static String getShortNames(Collection<DateTimeZone> tzList) {
    //Prebuild long form of timezones
    long nowTime = System.currentTimeMillis();
    Set<String> tzShortSet = Sets.newHashSet();
    for (DateTimeZone curTz : tzList) {
        if (StringUtils.startsWithIgnoreCase(curTz.getID(), "Etc/"))
            continue;
        tzShortSet.add(curTz.getShortName(nowTime));
    }/* w ww  .jav a2  s.c  om*/
    return StringUtils.defaultIfBlank(StringUtils.join(tzShortSet, ", "), null);
}