Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-20
18:11 • Ticket [e580d8372b] clock scan: half-hour time zones (IST, NST, CAST, …) are... artifact: 21f0304980 user: serhiy.storchaka
16:32 • Ticket [e580d8372b]: 3 changes artifact: 21645b3221 user: serhiy.storchaka
16:15 • Closed ticket [e580d8372b]. artifact: d0b7dbcc26 user: jan.nijtmans
16:13
Fix [e580d8]: [clock scan] put the half-hour time zones 30 minutes off check-in: ced6df1d18 user: jan.nijtmans tags: core-8-6-branch
16:05
Fix [e580d8]: [clock scan] put the half-hour time zones 30 minutes off check-in: a3c34ca27a user: jan.nijtmans tags: core-9-0-branch
15:55
Fix [e580d8]: [clock scan] put the half-hour time zones 30 minutes off check-in: 6a5a4260ee user: jan.nijtmans tags: trunk, main
2026-10-17
10:58 • Ticket [e580d8372b] clock scan: half-hour time zones (IST, NST, CAST, …) are... artifact: 41e9562473 user: serhiy.storchaka
10:57
Fix [e580d8372b]: [clock scan] put the half-hour time zones (IST, NST, CAST, ...) 30 minutes off. Si... closed check-in: 76ff177c47 user: serhiy.storchaka tags: clock-half-hour-zones
10:56 • Ticket [e580d8372b] clock scan: half-hour time zones (IST, NST, CAST, …) are... artifact: 568fcf4332 user: serhiy.storchaka
10:56 • New ticket [e580d8372b]. artifact: 7305ad4d23 user: serhiy.storchaka

[clock scan]: half-hour time zones (IST, NST, CAST, …) are 30 minutes off since 8.6.13

Closed / Fixede580d8372b585aab98deb370bbc9387c86add2f8Created 46 days agoUpdated 43 days ago
Descriptionwiki2026-10-17 10:56:03
[clock scan] puts the half-hour zones NFT, NST, NDT, IT, IST, JT, CAST and CADT 30 minutes off:
% clock format [clock scan "2026-01-15 12:00 IST"] -format %H:%M -gmt 1
07:00

The expected result is 06:30. For NST (Newfoundland), 12:00 gives 15:00 instead of 15:30.

The TimezoneTable in generic/tclGetDate.y writes these offsets as HOUR(11/2), HOUR(7/2) and so on. While the macro was ((int) (60 * x)), this expanded to 60 * 11/2 = 330. [2bb7cd72c8] (fix for [da6f155ca4], 2022) parenthesized x, so now 11/2 is computed first as an integer division and gives 5.

This is a regression in 8.6.13: 8.6.12 gives the correct times. It is present in 8.6.18, 9.0.5 and 9.1.0.

Referenced by1
  • 76ff177c47Fix [e580d8372b]: [clock scan] put the half-hour time zones (IST, NST, CAST, ...) 30 minutes off. Since [2bb7cd72c8] HOUR() parenthesizes its argument, so HOUR(11/2) was an integer division; use HOUR(11)/2. check-in2026-10-17 10:57:24
serhiy.storchaka Ticket [e580d8372b]: 2 changes [History diff]2026-10-17 10:56:10
serhiy.storchakawiki2026-10-17 10:58:10

Proposed fix in branch clock-half-hour-zones: the table entries now divide outside the macro, HOUR(11)/2, which is exact. Test clock-34.20.22.

jan.nijtmanswiki2026-10-20 16:15:11

Fixed in [trunk], core-9-0-branch and core-8-6-branch

Many thanks!

serhiy.storchakawiki2026-10-20 16:32:50

Jan,

Thanks for merging the [clock scan] half-hour time zone fix.

The new changes.md line on trunk (268f74c734, line 48) links to the Tk tracker:

 - [[clock scan] put the half-hour time zones 30 minutes off](https://core.tcl-lang.org/tk/tktview/e580d8)

It should be https://core.tcl-lang.org/tcl/tktview/e580d8. The 9.0 entry is correct.

Thanks also for fixing my "Merge mark" commit messages; I'll write "Close fork" next time.

Serhiy

serhiy.storchaka Ticket [e580d8372b]: 1 change [History diff]2026-10-20 18:11:29
Log in (anonymous is fine) to add a comment.