User:Connel MacKenzie/timezones

Hello, you have come here looking for the meaning of the word User:Connel MacKenzie/timezones. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:Connel MacKenzie/timezones, but we will also tell you about its etymology, its characteristics and you will know how to say User:Connel MacKenzie/timezones in singular and plural. Everything you need to know about the word User:Connel MacKenzie/timezones you have here. The definition of the word User:Connel MacKenzie/timezones will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:Connel MacKenzie/timezones, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

For an IRC chatbot, I needed to lookup what timezones existed. This proved to be much more challenging than one might expect. The "timezone name" allowed is an overlapping of several (conflicting) standards, apparently. The chatbot wants only the longest of those names (region/city.) Sigh. Well, very surprising to see missing TLAs in this list. Dunno if we want the ones containing slashes - on Wiktionary those are positively not allowed, yet this is (presumably) how people might look them up. --Connel MacKenzie 04:39, 13 January 2008 (UTC)

Code

Java

import java.util.TimeZone;
class timezones {
  public static void main(String args) {
    String zoneIds = TimeZone.getAvailableIDs();
    for (int i=0; i<zoneIds.length; i++) {
      System.out.println( zoneIds );
    }
  }
}

Groovy

def tzs = TimeZone.availableIDs.collect { TimeZone.getTimeZone(it) }
tzs.each { tz ->
    println "* ]"
    def names =  as SortedSet
    .each { style ->
        names << tz.getDisplayName(false, style)
        if (tz.useDaylightTime()) {
            names << tz.getDisplayName(true, style)
        }
    }
    names.each { name ->
        println "** ]"
    }
}

Results