我不知道 TCL 程序语言但知道 python,我需要修改一个 tcl 脚本来获得一个时间戳字符串,如050209012020
( %Y-%m-%d %H:%M:%S
)
首先你需要得到时间
set now [clock seconds]
Run Code Online (Sandbox Code Playgroud)
然后做相当于一个python f-string
set timestr [clock format $now -format "%y-%m-%d %H:%M:%S"]
Run Code Online (Sandbox Code Playgroud)
有关 更多详细信息,请参阅https://www.tcl.tk/man/tcl8.5/tutorial/Tcl41.html