Mercurial > hg > egg-tcls
changeset 360:2f7f18371b65
weather: Adjust time handling.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 12 Dec 2015 10:57:23 +0200 |
parents | 3b8ffc6eca6d |
children | 299cdd79b7ee |
files | weather.tcl |
diffstat | 1 files changed, 3 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/weather.tcl Fri Dec 11 23:13:54 2015 +0200 +++ b/weather.tcl Sat Dec 12 10:57:23 2015 +0200 @@ -144,11 +144,11 @@ set uvals(station) [lindex $udata 0] set uvals(type) [lindex $udata 1] set uvals(vtime) [lindex $udata 2] - set utime_d [expr [clock seconds] - $uvals(vtime)] - if {$utime_d < 3600} { + + if {[expr [clock seconds] - $uvals(vtime)] < 3600} { set uvals(ctime) [clock format $uvals(vtime) -format "%H:%M"] } else { - set uvals(ctime) [clock format $uvals(vtime) -format "%H:%M (%D)"] + set uvals(ctime) [clock format $uvals(vtime) -format "%H:%M (%d.%m.%Y)"] } set uvals(temp) [lindex $udata 3] @@ -165,9 +165,6 @@ # Transform the format list set astr "" - if {$utime_d >= 3600} { - set astr "** " - } foreach aitem $weather_msg_result { set atmp $aitem foreach {akey aval} [array get uvals] {