Andrew Milner <[email protected]> writes:

> mmmm
> think I agree except for preferring to going to last day of m rather than 
> first day of m+1 because otherwise you can end up in the situation where 
> month - 1 leaves you in the same month which does not seem right.

That's a good point about preferring a different calendar month.  Your
strategy also leads to reasonable day-deltas, 3/31 leads to 2/28 which
is....  31 days ago.  So I think we'd end up with 28-31 days between any
pair "today" and "a month ago from today ", which is a good property.

You have convinced me to change to move earlier to valid day.   That's
pretty simple, too, just set to last day of month if calculated is > last.

> otherwise I think your logic is spot-on, and I was confusing myself by 
> considering the lengths of the months inbetween rather than just 
> considering the final landing month.

I was trying to think "If I ask some random person on the street: what
date is today?  what date was 4 months ago?" what answer would I get and
then trying to mechanize that.

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/rmisgor83s9.fsf%40s1.lexort.com.

Reply via email to