Well personally I would say that it is an error to say 31 mar - 1 month = 3 mar, although I appreciate the logic behind the outcome. I guess it all depends on how 'month' is defined! if 'month' is defined as length of ciurrent month the date - month should return date - number of days in current month and so 31 mar would return 28 feb 30 mar would return 27 feb 29 mar would return 26 feb
i do not think it is correct to advance forwards into march as date appears to do. On Thursday, 19 September 2019 14:44:46 UTC+3, Greg from Oz wrote: > > date --date="2019/03/29 -1 month" > Fri 1 Mar 00:00:00 AEDT 2019 > > date --date="2019/03/30 -1 month" > Sat 2 Mar 00:00:00 AEDT 2019 > > date --date="2019/03/31 -1 month" > Sun 3 Mar 00:00:00 AEDT 2019 > > > On Thursday, 19 September 2019 20:39:31 UTC+10, Andrew Milner wrote: >> >> what do sqlite3 and bash return on say 29, 30 and 31 march when one tries >> to subtract 1 month? >> >> >> >> >> On Thursday, 19 September 2019 10:51:04 UTC+3, Graham Eddy wrote: >>> >>> don’t know enough about specifying timespans within weewx but you can do >>> things like >>> sqlite3> select datetime(dateTime, 'unixepoch’, ’localtime’, ’-1 >>> months’) from archive; >>> and >>> bash$ date -v-1m >>> ____________ >>> *Graham Eddy* >>> >>> On 19 Sep 2019, at 4:37 pm, gjr80 <[email protected]> wrote: >>> >>> I had a similar issue with WeeWX-WD some years back, the Saratoga >>> templates needed to display some observation (temp or rain - can't >>> remember) for the same time past month. To be honest I can't remember what >>> I had it return for 'problem' dates, it certainly was not None or some >>> other undefined value. >>> >>> That aside, whether you call it a bug or not I don't think we should >>> have a tag that when you give it an allowed value/parameter it aborts the >>> template. Perhaps return None so the template is still processed and then >>> at least the user has some value to hang his hat on. >>> >>> Gary >>> >>> -- >>> 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/6b4c212c-2225-4771-8bdd-92631109aff7%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/weewx-user/6b4c212c-2225-4771-8bdd-92631109aff7%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >>> >>> -- 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/8ea9163d-691c-4b46-893d-1cc8142d6196%40googlegroups.com.
