On 06/02/17 03:49 PM, Dave Webb KB1PVH wrote:
Put this somewhere in your index.html.tmpl#set $now = $current.dateTime.raw #set $yesterday = $now - 24*3600#set $today_daylight = $almanac.sun.set.raw - $almanac.sun.rise.raw #set $yesterday_daylight = $almanac($almanac_time=$yesterday).sun.set.raw - $almanac($almanac_time=$yesterday).sun.rise.raw#set $difference = $today_daylight - $yesterday_daylight #set $seconds = $almanac.sun.set.raw - $almanac.sun.rise.raw #set $hours = $seconds //3600 #set $seconds %= 3600 #set $minutes = $seconds//60 #set $seconds %= 60<p>$("Today has %d hours, %d minutes, and %d seconds of daylight" % ($hours, $minutes, $seconds)),<br/>#if $difference > 0 $("%d seconds more than yesterday." % $difference)</p> #else $("%d seconds less than yesterday." % -$difference)</p> #end if #else Dave-KB1PVH
Thanks, Dave! Exactly what I wanted. I had to get rid of the final #else so cheetahgenerator wouldn't complain, but I think that's a function of where I put it.
<http://www.ve1dx.net/> 73, Paul VE1DX -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
