Better way of determining midnight (does not require jim patch)
This commit is contained in:
parent
789950858d
commit
59bbcc09fb
@ -13,8 +13,10 @@ proc lremove {var val} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Returns the epoch time for midnight today, accounting for local timezone
|
# Returns the epoch time for midnight today, accounting for local timezone
|
||||||
proc midnight {} {
|
proc midnight {} {{today ""}} {
|
||||||
#return $([clock seconds] / 86400 * 86400)
|
if {$today eq ""} {
|
||||||
set day [clock scan "00:00:00" -format "%T"]
|
set today [clock format [clock seconds] -format "%Y %m %d"]
|
||||||
|
}
|
||||||
|
return [clock scan "$today 00:00:00" -format "%Y %m %d %T"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user