A better version contributed by emiliano on the Tcl Chat. By the way, I recommend you to visit it... (
http://wiki.tcl.tk/2619)
catch {clock format}
rename ::tcl::clock::format ::tcl::clock::_format
proc ::tcl::clock::format {clockval args} {
if {([llength $args] % 2 == 0) && "-format" in [dict keys $args]} {
dict set args -format \
[string map {%F {%Y-%m-%d}} [dict get $args -format]]
}
tailcall _format $clockval {*}$args
}
$ clock format [clock seconds] -format %F
2017-12-18