Version 9 of Worldtime-clock

Updated 2012-02-21 20:44:47 by HJG

HJG 2012-02-02 Small and simple program to show the time at some selected places around the world. With some tweaks to the tcl-console.

 # Worldtime-clock - http://wiki.tcl.tk/14375
 # HaJo Gurt - 2012-02-02

  catch {console show}
  catch {wm withdraw .}
 #console eval {wm geometry . 56x25}
 # Resize console & position it at top-right corner on screen, for 1024x768:
  console eval {wm geometry . 56x25+550+0} 
  console eval {.console config -bg grey -fg blue}

  proc q {} {exit}

  proc w {} {
    puts "Time around the world:"
    foreach tz {
       :Pacific/Honolulu
       :America/Los_Angeles        
       :America/Chicago
       :America/New_York
       :UTC
       :Europe/Berlin
       :Africa/Cairo
       :Europe/Moscow
       :Asia/Tokyo
       :Australia/Canberra }  {
         set td [clock format [clock seconds] \
            -format "%H:%M:%S  %Y-%m-%d  %a  %z" -timezone $tz] 
         puts [format "%-22s %s" $tz $td] 
    }
  }

  console title "Worldtime - w to refresh, q to quit"
  w

 #.

Result:

Time around the world:
:Pacific/Honolulu      10:25:00  2012-02-13  Mon  -1000
:America/Los_Angeles   12:25:00  2012-02-13  Mon  -0800
:America/Chicago       14:25:00  2012-02-13  Mon  -0600
:America/New_York      15:25:00  2012-02-13  Mon  -0500
:UTC                   20:25:00  2012-02-13  Mon  +0000
:Europe/Berlin         21:25:00  2012-02-13  Mon  +0100
:Africa/Cairo          22:25:00  2012-02-13  Mon  +0200
:Europe/Moscow         23:25:00  2012-02-13  Mon  +0300
:Asia/Tokyo            05:25:00  2012-02-14  Tue  +0900
:Australia/Canberra    07:25:00  2012-02-14  Tue  +1100

See also: Wallclock - clock format - timezone - Windows wish console