sqlite> select datetime('2019-03-15 12:00:00', '-1 months');
2019-02-15 12:00:00
sqlite> select datetime('2019-03-28 12:00:00', '-1 months');
2019-02-28 12:00:00
sqlite> select datetime('2019-03-29 12:00:00', '-1 months');
2019-03-01 12:00:00
sqlite> select datetime('2019-03-30 12:00:00', '-1 months');
2019-03-02 12:00:00
sqlite> select datetime('2019-03-31 12:00:00', '-1 months');
2019-03-03 12:00:00
sqlite> select datetime('2019-04-01 12:00:00', '-1 months');
2019-03-01 12:00:00
sqlite> select datetime('2019-03-04 12:00:00', '-1 months');
2019-02-04 12:00:00bash$ date -j '0315120019' Fri 15 Mar 2019 12:00:00 AEDT bash$ date -j -v-1m '0315120019' Fri 15 Feb 2019 12:00:00 AEDT bash$ date -j -v-1m '0329120019' Thu 28 Feb 2019 12:00:00 AEDT bash$ date -j -v-1m '0330120019' Thu 28 Feb 2019 12:00:00 AEDT bash$ date -j -v-1m '0331120019' Thu 28 Feb 2019 12:00:00 AEDT ____________ Graham Eddy > On 19 Sep 2019, at 8:39 pm, Andrew Milner <[email protected]> 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 > -- 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/AFAC6A28-CB8D-4172-994E-B377915D87FC%40gmail.com.
