hi, I have a Question about time.
how can I make the hour and minute be two digits??
for example,
5--> 05
can I use like this way??
if {$minFormat <10 } {
set minFormat "0$minFormat"
}
thank you in advance
Well, it depends on what you want to do with it. For instance, if you just want to return the formatted value in the console, puts [format "%02i" $minFormat] will do it. If you want a persistent string that has the formatted characteristics, set minString [format "%02i" $minFormat] is what you want.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.