DeVon_Jarvis
Altostratus
Nov 16, 2008Here is what I found out. The octal concern is not an issue any more, but comparing anything to 0800 (leading zero) seems to do a string compare, which leads to incorrect results.
What I did was to change the clock format string to:
set t_array [split [clock format [clock seconds] -format {%u %k %M}] " "]
The %k gives you the hours in 24 hour clock without any leading zeros. Yay! Just what we wanted!
This way, numeric comparisons prevail and we get just what we wanted.
I also optimized my version to only do these comparisons once each minute, and store the result in a global variable. This saves lots of processing especially on a busy site! No need to check on every request, as the status of the outage window will not change anyway.
If you want my version of the code, let me know and I will submit it.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)