Overview
| Artifact ID: | 0a33eb00ee2f018dbb7f7f2470d8bc72876da7e4 |
|---|---|
| Ticket: | 1902423fffffffffffffffffffffffffffffffff
clock format gives wrong result |
| User & Date: | gneumann on 2008-02-26 18:55:13 |
Changes
- assignee changed to: "kennykb"
- cmimetype changed to: "text/plain"
- comment changed to:
clock format returns under certain conditions an incorrect "%T" in the formatted time-string, when "%H:%M:%S" was requested Example (see result of the 2nd [clock format ...]): % set s [clock seconds] 1204049747 % set f1 [clock format $s -format "%Y-%m-%d %T"] 2008-02-26 19:15:47 % set f2 [clock format $s -format "%Y-%m-%d %H:%M:%S"] 2008-02-26 %T % set ::tcl_patchLevel 8.5.1 the used locale is "C". A quick analysis shows that ParseClockFormatFormat2 builds an incorrect formatting proc: =================== proc ::tcl::clock::formatproc'%Y-%m-%d %H:%M:%S'C {clockval timezone} { variable TZData set date [GetDateFields $clockval $TZData($timezone) 2299161] return [::format {%04d-%02d-%02d %%T} [dict get $date year] [dict get $date month] [dict get $date dayOfMonth]] } =================== One can see that for some reasons, %%T was added to the format string. The reason seems to be that LocalizeFormat C {%Y-%m-%d %H:%M:%S} returns {%Y-%m-%d %T}, most likely due to a caching bug. - foundin changed to: "obsolete: 8.5.1"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "gneumann"
- subsystem changed to: "06. Time Measurement"
- title changed to: "clock format gives wrong result"
- type changed to: "Bug"