That's odd, I get a $min of 10080
That should work as a good expire time as it is an integer number.
Have you used the very last code I posted without edits?
Well, I'm too used to use languages interpreting "" as 0simo wrote:tested your latest code CC and got:
Tcl error [sticky_bansx]: missing operand at _@_
in expression "365*24*60*_@_"
Code: Select all
proc delay2min {delay} {
regexp {((\d{1,})y)?((\d{1,})w)?((\d{1,})d)?((\d{1,})h)?(\d{1,})?} $delay - iy by iw bw id bd ih bh bm
set min 0
if {[string is integer by]} { incr min [expr 365*24*60*$by] }
if {[string is integer bw]} { incr min [expr 7*24*60*$bw] }
if {[string is integer bd]} { incr min [expr 24*60*$bd] }
if {[string is integer bh]} { incr min [expr 60*$bh] }
if {[string is integer bm]} { incr min [expr 1*$bm] }
return $min
}
Code: Select all
set dur [duration [expr {60*$min}]]