Wednesday, October 29, 2008

fixed nicer index.adp aolserver

if {$uptime < 60} {
set uptime [format %.2d $uptime]
} elseif {$uptime < 3600} {
set mins [expr $uptime / 60]
set secs [expr $uptime - ($mins * 60)]

set uptime "[format %.2d $mins]:[format %.2d $secs]"
} elseif {$uptime < 86400} {
set hours [expr $uptime / 3600]
set mins [expr ($uptime - ($hours * 3600)) / 60]
set secs [expr $uptime - (($hours * 3600) + ($mins * 60))]

set uptime "${hours}:[format %.2d $mins]:[format %.2d $secs]"
} else {
set days [expr $uptime / 86400]
set hours [expr ($uptime - ($days * 86400)) / 3600]
set mins [expr ($uptime - (($days * 86400) + ($hours * 3600))) / 60]
set secs [expr ($uptime - (($days * 86400) + ($hours * 3600) + ($mins * 60)))]

set uptime "${days}d-[format %.2d $hours]h-[format %.2d $mins]m-[format %.2d $secs]s"
}

No comments: