List of usage examples for org.joda.time DateTimeZone getShortName
public final String getShortName(long instant)
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); }