diff --git a/webif/lib/utils b/webif/lib/utils index bab547c..53eaf04 100644 --- a/webif/lib/utils +++ b/webif/lib/utils @@ -13,8 +13,10 @@ proc lremove {var val} { } # Returns the epoch time for midnight today, accounting for local timezone -proc midnight {} { - #return $([clock seconds] / 86400 * 86400) - set day [clock scan "00:00:00" -format "%T"] +proc midnight {} {{today ""}} { + if {$today eq ""} { + set today [clock format [clock seconds] -format "%Y %m %d"] + } + return [clock scan "$today 00:00:00" -format "%Y %m %d %T"] }