Ruben,
Below is a larger portion of my index.html so you can see placement.
#else
<tr>
<td class="label">New moon:</td>
<td class="data">$almanac.next_new_moon</td>
</tr>
<tr>
<td class="label">Full moon:</td>
<td class="data">$almanac.next_full_moon</td>
</tr>
#end if
<tr>
<td class="label">Phase:</td>
<td
class="data">$almanac.moon_phase<br/>($almanac.moon_fullness%
illuminated)</td>
</tr>
</table>
</div> <!-- end class "celestial_body" -->
#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
## No extended almanac information available. Fall back to a
simple table.
<table>
<tr>
<td class="label">Sunrise:</td>
<td class="data">$almanac.sunrise</td>
</tr>
<tr>
<td class="label">Sunset:</td>
<td class="data">$almanac.sunset</td>
</tr>
<tr>
<td class="label">Moon Phase:</td>
You can also read this thread
https://groups.google.com/forum/#!searchin/weewx-user/hours$20of$20daylight%7Csort:relevance/weewx-user/gc1urPvD_1M/-S_fvND15vsJ
Dave-KB1PVH
On Thu, Feb 9, 2017 at 9:19 AM, Dave Webb KB1PVH <[email protected]> wrote:
> Ruben,
>
> I will copy a bigger portion of the index.html.tmpl shortly so you can
> see exactly where I put it.
>
> Dave-KB1PVH
>
>
> Sent from my Galaxy S7
>
> On Feb 9, 2017 9:15 AM, "Ruben Navarro Huedo" <[email protected]> wrote:
>
>> A lot of thank's.
>>
>> I have tried to add your code to calculate hours of daylight but weewx
>> doesn't show in my web site :-(
>>
>>
>> El jueves, 9 de febrero de 2017, 14:34:05 (UTC+1), Dave Webb escribió:
>>>
>>> Ruben,
>>>
>>> I use the widget from here.
>>>
>>> http://blog.darksky.net/forecast-embeds/
>>>
>>> Dave-KB1PVH
>>>
>>>
>>> Sent from my Galaxy S7
>>>
>>> On Feb 9, 2017 8:29 AM, "Ruben Navarro Huedo" <[email protected]> wrote:
>>>
>>> A lot of thanks for info Dave
>>>
>>> I tried add forecast to my weewx website but using includes all tables
>>> were incorrectly formatted.
>>>
>>> How did you insert forecast in the main page?
>>>
>>> 73 de EA5BZ
>>>
>>> --
>>> 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.
>>
>
--
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.