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

On Mon, Feb 6, 2017 at 2:42 PM, WindnFog <[email protected]> wrote:

> Yes, although I didn't ask the original question.  How are you doing that,
> Dave?  Looks interesting.
>
> On Monday, February 6, 2017 at 11:18:47 AM UTC-4, Dave Webb wrote:
>>
>> Steve,
>>
>> Something like I have on my page?
>>
>> qsl.net/kb1pvh/weather - private <http://qsl.net/kb1pvh/weather>
>>
>>
>> Dave-KB1PVH
>>
>>
>> Sent from my Galaxy S7
>>
>> On Feb 6, 2017 10:15 AM, "WindnFog" <[email protected]> wrote:
>>
>>>
>>>
>>> On Sunday, December 29, 2013 at 12:24:20 PM UTC-4, Steve wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I was wondering if it is possible for the Almanac data to calculate and
>>>> display hours of daylight?
>>>>
>>>> i.e Sunset - Sunrise = hh:mm:ss and / or End Civil twilight - Start
>>>> Civil twilight = hh:mm:ss
>>>>
>>>> (What (to me) would even be better is if the daylight hh:mm:ss each day
>>>> was somehow included in the DB so it could be graphed and viewed as a sine
>>>> wave over a year / ramps up and down for month & week views, I guess it
>>>> would just flat line in a daily view?).
>>>>
>>>> It's interesting to me because I have a PV solar system on my roof too,
>>>> and the weather plays a great deal with what it generates.
>>>>
>>>> Regards,
>>>>
>>>> Steve.
>>>>
>>> --
>>> 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 - private
>>> <https://groups.google.com/d/optout>.
>>>
>> --
> 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.
>

-- 
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.

Reply via email to