Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2012-01-09
03:52 • Closed ticket [3470928fff]: clock format plus 7 other changes artifact: fe13950e09 user: kennykb
02:32 • Ticket [3470928fff]: 4 changes artifact: 9b2be3ec83 user: diffur
01:28 • Ticket [3470928fff]: 1 change artifact: 05b330e77b user: ferrieux
2012-01-08
23:19 • Ticket [3470928fff]: 4 changes artifact: a31fe211aa user: ferrieux
18:19 • Open ticket [3470928fff]. artifact: 4527b92b71 user: diffur
17:09 • Ticket [3470928fff]: 4 changes artifact: d74a6976d4 user: ferrieux
17:08 • Pending ticket [3470928fff]. artifact: 13d13e55cd user: ferrieux
14:43 • Ticket [3470928fff]: 4 changes artifact: 8a2946ddf9 user: diffur
14:35 • Ticket [3470928fff]: 1 change artifact: aa74b26446 user: diffur
14:34 • Ticket [3470928fff]: 1 change artifact: 516fff8464 user: diffur
07:33 • New ticket [3470928fff]. artifact: b2126aa8ae user: diffur

clock format

Closed / Fixed3470928fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2012-01-08 07:33:10
% clock format [clock seconds] -format {(%A) %d %B %Y %T %Z(UTC%z)} -timezone Africa/Windhoek
time zone Africa/Windhoek not found

% clock format [clock seconds] -format {(%A) %d %B %Y %T %Z(UTC%z)} -timezone :Africa/Windhoek
time zone ":Africa/Windhoek" not found

% file exists /usr/share/zoneinfo/Africa/Windhoek
1

What caused this behavior?
diffur Ticket [3470928fff]: 1 change [History diff]2012-01-08 14:34:26
diffur Ticket [3470928fff]: 1 change [History diff]2012-01-08 14:35:28
diffurplain2012-01-08 14:43:08
$ tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
 1) Africa
 2) Americas
 3) Antarctica
 4) Arctic Ocean
 5) Asia
 6) Atlantic Ocean
 7) Australia
 8) Europe
 9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
#? 1
Please select a country.
 1) Algeria  18) Gabon    35) Rwanda
 2) Angola  19) Gambia    36) Sao Tome & Principe
 3) Benin  20) Ghana    37) Senegal
 4) Botswana  21) Guinea    38) Sierra Leone
 5) Burkina Faso  22) Guinea-Bissau    39) Somalia
 6) Burundi  23) Kenya    40) South Africa
 7) Cameroon  24) Lesotho    41) South Sudan
 8) Central African Rep.  25) Liberia    42) Spain
 9) Chad  26) Libya    43) Sudan
10) Congo (Dem. Rep.)  27) Malawi    44) Swaziland
11) Congo (Rep.)  28) Mali    45) Tanzania
12) Cote d'Ivoire  29) Mauritania    46) Togo
13) Djibouti  30) Morocco    47) Tunisia
14) Egypt  31) Mozambique    48) Uganda
15) Equatorial Guinea  32) Namibia    49) Western Sahara
16) Eritrea  33) Niger    50) Zambia
17) Ethiopia  34) Nigeria    51) Zimbabwe
#? 32

The following information has been given:

Namibia

Therefore TZ='Africa/Windhoek' will be used.
Local time is now:Вс. янв.  8 09:42:10 WAST 2012.
Universal Time is now:Вс. янв.  8 07:42:10 UTC 2012.
Is the above information OK?
1) Yes
2) No
#?
ferrieux Pending ticket [3470928fff]. [History diff]2012-01-08 17:08:34
ferrieuxplain2012-01-08 17:09:50
Works for me, on both 8.5 and 8.6 Heads. Since 'fossil finfo library/tzdata/Africa/Windhoek' shows no change since 2009, I'd bet you have a Tcl installation problem.
What does [info library] return ?
What files do you have under [info library]/tzdata ?
Is Africa/Windhoek in there ?
diffurplain2012-01-08 18:19:08
% info library
/usr/lib/tcl8.5

no directory /usr/lib/tcl8.5/tzdata
TCL use files from directory /usr/share/zoneinfo

$ ls /usr/share/zoneinfo/Africa/Windhoek
/usr/share/zoneinfo/Africa/Windhoek


I use Arch Linux. But the problem is and on other OS for example Debian. This is not a problem of installation. Since the file /usr/share/zoneinfo/iso3166.tab contains 414 timezones. The only problem with Africa/Windhoek
ferrieuxplain2012-01-08 23:19:40
As it turns out, the code in clock.tcl always tries [info library]/tzdata before going to the system-provided zoneinfo files:

[catch {
    LoadTimeZoneFile [string range $timezone 1 end]
}] && [catch {
    LoadZoneinfoFile [string range $timezone 1 end]
}]

The idea, then, is that tzdata guarantee a good coverage, and leave it to the local system for extras.
Hence I think it is a dubious move from a distribution packager to omit the tzdata dir (which is part of the Tcl sources), since the local system may have holes, as seems to be your case.

For us to be able to warn the packagers, please be more precise in your description of what distros have the problem, that was unclear; in the meantime, a quick fix is to copy the tzdata dir from the source distribution into your /usr/lib/tcl8.5.
ferrieux Ticket [3470928fff]: 1 change [History diff]2012-01-09 01:28:21
diffurplain2012-01-09 02:32:19
TCL recompiled with --with-tzdata. But there were some problems with time zones


% clock format [clock seconds] -format {%A, %d %B %Y %T UTC%z (%Z)} -timezone Europe/Kiev
Sunday, 08 January 2012 22:17:01 UTC+0300 (FET)

http://twiki.org/cgi-bin/xtra/tzdate?tz=Europe/Kiev
Date&time: Sun, 08 Jan 2012 21:17:01 +0200 (EET)

also with: Europe/Uzhgorod Europe/Zaporozhye Europe/Simferopol

% clock format [clock seconds] -format {%A, %d %B %Y %T UTC%z (%Z)} -timezone Asia/Macau
Monday, 09 January 2012 03:29:38 UTC+0800 (MOT)

http://twiki.org/cgi-bin/xtra/tzdate?tz=Asia/Macau
Date&time: Mon, 09 Jan 2012 03:29:38 +0800 (CST)

Why is that?
kennykbplain2012-01-09 03:52:22
allow_comments - 1

Tcl's zoneinfo reader had a problem with the Windhoek data file. There is a very strange sort-of-optimization where two timezone abbreviations can use the same bytes of the file if one is a proper suffix of another, and Tcl wasn't prepared to handle that case. Fixed now.
Log in (anonymous is fine) to add a comment.