Version 3 of Localized clock

Updated 2005-04-14 18:57:58 by lwv

What's the standard Tcl way (package?) to localize 'clock'. In any country, I'll get this:

    % clock format [clock seconds]
    Wed Apr 13 17:20:53 +0100 2005

But that 'Wed', 'Apr', are English-only. How do Tcl'ers handle this? - RS often uses this ISO-like format, good for sorting:

 % clock format [clock sec] -format %Y-%m-%d,%H:%M:%S
 2005-04-13,18:36:18

Ah, yes, but if I want to display a localized date to the user, their own language would be nice...


LES:

 proc  {mês em português}  {}          {

         set  Month          [ clock format [clock sec] -format "%m" ]

         set  Meses          {
                 0
                 janeiro          fevereiro          março                  abril
                 maio                  junho                julho                agosto
                 setembro        outubro                novembro        dezembro
         }

         set  Mes          [ lindex  $Meses  [ format "%d" $Month ] ]
         set  Month          [ clock format [clock sec] -format "%B" ]

         puts "this is $Month"
         puts "estamos em $Mes"
 }

 {mês em português}

LV Check out Tcl 8.5a1 or newer. Kevin Kenny has been working hard to provide the functionality you desire. See http://tip.tcl.tk/173 for details.

Indeed, Tcl 8.5a1 supports localization of all those languages dependent names for day of week (including abbreviations), month of year, etc.

A simple example is:

    to be written...

Category Date and Time