Better way of determining midnight (does not require jim patch)

This commit is contained in:
HummyPkg 2019-05-08 14:20:07 +01:00
parent 789950858d
commit 59bbcc09fb
1 changed files with 5 additions and 3 deletions

View File

@ -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"]
}