I must confess that initially the use of --date or --to and/or --from and the use of the "T" struck me as complicated and not very intuitive. As far as I am aware wee_import and wunderfixer are the only utilities that use a date or date-time parameter (wee_reports accepts a timestamp), though I note that issue #117 will likely see wee_database need a date (not a date-time) range and one could make a case for wunderfixer to accept a date (again not a date-time) range as well. I guess it would be good to lay down a standard now. That being I am coming aroun dto the --date/--to/--from usage outlined below as it's no more difficult to process and arguably makes input a little simpler for the user.
In terms of wee_import, at the moment the --date option is coded that it will accept a single d/m/y date OR a single d/m/y H:M date-time OR a date range d1/m1/y1-d2/m2/y2 OR a date-time range d1/m1/y1 H1:M1-d2/m2/y2 H2:M2 only - anything else is rejected. The subtle point being that a date - date-time range (ie d1/m1/y1-d2/m2/y2 H2:M2 or d1/m1/y1 H1:M1-d2/m2/y2) is not accepted. That makes the format for the option a little more complex. It is easily fixed though, just need to recode the --date option parsing. Gary On Saturday, 8 October 2016 22:32:48 UTC+10, Tom Keffer wrote: > > For separating date and time, one strategy I've seen is to use a "T". Then > you don't need the quotes. So, a date range would be: > > --date=2016/09/28T03:00-2016/10/02T12:00 > > > But I can see another issue. wunderfixer uses a different format: > > --date=YYYY-mm-DD > > > Personally, I prefer this to YYYY/mm/DD, but using hyphens here means we > can't use them for date ranges. > > So, I would suggest that when one wants a date range, you use a different > set of options: > > --from=YYYY-mm-DDTHH:MM --to=YYYY-mm-DDTHH:MM > > > An example would look like: > > --from=2016-09-28T03:00 --to=2016-10-02T12:00 > > You use either --date or --from/--to, but not both. > > -tk > > On Sat, Oct 8, 2016 at 5:06 AM, mwall <[email protected] > <javascript:>> wrote: > >> >> >> On Saturday, October 8, 2016 at 1:46:03 AM UTC-4, gjr80 wrote: >>> >>> >>>> >>>> Oh yes - somewhere in the instructions (or help, not sure which) - the >>>> time in the --date command is in brackets. I presume this is because the >>>> time is optional - but why the brackets? An option in syntax definitions >>>> is (I thought) indicated by | whilst the inclusion of brackets implies the >>>> time should be enclosed in brackets - which is wrong (I think). >>>> >>>> >>> It is the Utilities guide and the --help usage text. The hh:mm in a >>> range is optional. I will get some input from Tom and Matthew, can you >>> have nested [ ], if not you end up with a very long line. >>> >> >> the current (explicit) form is: >> >> [--date=YYYY/MM/DD|'YYYY/MM/DD hh:mm'|'YYYY/MM/DD (hh:mm)-YYYY/MM/DD >> (hh:mm)'] >> >> >> technically that should be: >> >> [--date=(YYYY/mm/dd|'YYYY/mm/dd HH:MM'|'YYYY/mm|dd (HH:MM)-YYYY/mm/dd >> (HH:MM)')] >> >> >> a more compact form would be: >> >> [--date="YYYY/mm/dd[ HH:MM][-YYYY/mm/dd[ HH:MM]]"] >> >> with the caveat that quotes are required only if the date string contains >> any spaces. >> >> note that month should be mm because minutes is MM >> >> m >> >> -- >> 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] <javascript:>. >> 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.
