![]() |
|
|
#2 (permalink) |
|
Administrator
aka aqwzsx |
# -------------------------
# www.bot.net.ru (c) DlMA # ------------------------- Code:
proc stime2 {t} {
if {![isnumber $t]} {return "??time??"}
if {$t<0} {return "?? seconds"}
if {$t<60} {return "$t seconds"}
if {$t<3600} {return [format "%02d minutes %02d seconds" [expr $t/60] [expr $t%60]]}
if {$t<3600*24} {return [format "%02d hours %02d minutes" [expr $t/(60*60)] [expr ($t/60)%60]]}
if {$t<3600*24*100} {return [format "%02d days %02d hours" [expr $t/(3600*24)] [expr ($t/3600)%24]]}
return [format "%d days" [expr $t/(60*60*24)]]
}
|
|
|
|