how can i change the output of this :
at the moment it shows 455 weeks 1 day.
How can i make it to show years instead?
Code: Select all
proc timedate{ timeis } {
global bopen bclose
set timestamp [lindex $timeis 0]
set added [ctime $timestamp]
set time1 [clock seconds]
incr time1 -$timestamp
set ago [string map {" years" "y" " weeks" "w" " days" "d" " hours" "h" " minutes" "m" " seconds" "s" " year" "y" " week" "w" " day" "d" " hour" "h" " minute" "m" " second" "s"} [duration $time1]]
set timedate $ago ago $added\00315"
return $timedate
}
Thanks to thommey for this fix.
If you have multiple scripts, with '[duration]' then it will be overwritten by other scripts.
A hacky solution is:
At the bottom of your conf file, where you load your scripts at this BEFORE the 'source sctipt/xxx.tcl'
Code: Select all
rename duration egg_duration; proc duration {s} {return $s}
Code: Select all
rename duration ""; rename egg_duration duration