| Ticket UUID: | e580d8372b585aab98deb370bbc9387c86add2f8 | ||
| Title: | [clock scan]: half-hour time zones (IST, NST, CAST, …) are 30 minutes off since 8.6.13 | ||
| Type: | Bug | Created on: | 2026-10-17 10:56:03 |
| Submitter: | serhiy.storchaka | Assigned to: | jan.nijtmans |
| Subsystem: | 06. Time Measurement | Severity: | Minor |
| Priority: | 5 Medium | Last modified: | 2026-10-20 18:11:29 |
| Status: | Closed | Closed by: | jan.nijtmans |
| Resolution: | Fixed | Closed on: | 2026-10-20 16:15:11 |
| Version: | 8.6.18, 9.0.5, 9.1.0 | ||
| Description: | ||||
|
[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. | ||||
| User Comments: | ||||
serhiy.storchaka added on 2026-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.nijtmans added on 2026-10-20 16:15:11:
Fixed in [6a5a4260ee|trunk], core-9-0-branch and core-8-6-branch Many thanks! serhiy.storchaka added on 2026-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 | ||||
