Fix calculation for midnight today

This commit is contained in:
HummyPkg 2019-02-05 14:03:36 +00:00
parent e595c6b17b
commit b9bf4fc5d3
3 changed files with 7 additions and 2 deletions

View File

@ -306,7 +306,7 @@ proc render_timeline {usedhours} {
set tomorrow {}
# Midnight today.
set day [clock scan "00:00:00" -format "%T"]
set day [midnight]
set elength [llength $events]
set eindex 0

View File

@ -1291,7 +1291,7 @@ proc {rsv allevents} {{xota 0}} {
lappend events {*}$pending
}
set today [clock scan 00:00:00 -format "%T"]
set today [midnight]
set xevents {}

View File

@ -12,3 +12,8 @@ proc lremove {var val} {
set v [lsearch -all -inline -not -exact $v $val]
}
# Returns the epoch time for midnight today
proc midnight {} {
return $([clock seconds] / 86400 * 86400)
}