Re: [weewx-user] Rainyear

64 views
Skip to first unread message

Thomas Keffer

unread,
May 16, 2019, 9:37:33 PM5/16/19
to weewx-user
The rain year runs from 1-October-2018 00:00:00 to 1-October-2019 00:00:00, which is why you're getting the results you are getting. 

It's a hack, but you could get what you want by subtracting a second off the end, then doing your own formatting. It would look something like this:

#import time
#set almost_end = $rainyear.end.raw - 1
#set almost_end_tt = $time.localtime($almost_end)
<p>The end of the rain year is $time.strftime("%B %Y", $almost_end_tt)</p>

On Wed, May 15, 2019 at 7:40 AM steeple ian <steep...@gmail.com> wrote:
I am trying to create an html.tmpl which includes $rainyear starting in October. (setting in weewx.conf is 10)

 "$rainyear.start.format(format_string="%B %Y")"; results in "October 2018"
 "$rainyear.end.format(format_string="%B %Y")"; results in "October 2019"

What I really want is to make rain_year_end to result in "September 2019"

Struggling to get my head round it.

Please can somebody come to my rescue.

Thanks,
Ian


--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/fddb8be6-9987-498b-a205-bfaaf7c99ff5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

steeple ian

unread,
May 20, 2019, 5:41:06 AM5/20/19
to weewx...@googlegroups.com
Thanks Thomas,

This solution worked perfectly.

Ian

Reply all
Reply to author
Forward
0 new messages