if {package vcompare [package provide Tcl 8] < 0} {
# There is a bug in [clock format] (fixed in Tcl 7.6p2) which causes it # to fail if the value of the -format option does not contain a '%'. rename clock Tcl7.6_clock ;proc clock {option args} { switch -glob -- $option { f* { if {[string first $option format] != 0} { return [uplevel [list Tcl7.6_clock $option] $args] } array set tmp [lrange $args 1 end] if {[catch {regexp % $tmp(-format)} hasPercent] || $hasPercent} { return [uplevel [list Tcl7.6_clock $option] $args] } else { return $tmp(-format) } } default { uplevel [list Tcl7.6_clock $option] $args } } } }