Scarygami / location-history-json-converter

Convert the Location History JSON File from Google Takeout into a useable format
Apache License 2.0
481 stars 118 forks source link

startendtime #31

Closed ChickenSupreme closed 4 years ago

ChickenSupreme commented 4 years ago

This pull request adds --starttime and --endtime arguments. The arguments are only used when the corresponding date argument is set (e.g. starttime requires startdate and so on).

For example, --startdate 2012-05-01 --starttime 07:00 will use "2012-05-01 07:00" as the start date/time and --enddate 2012-05-02 --endtime 07:00 will use "2012-05-02 06:59:59.999999" as the end date/time.

Please do review the code before merging as I am new to GitHub and haven't done any serious coding in a decade.

ChickenSupreme commented 4 years ago

I made a mistake in the above comment, --enddate 2012-05-02 --endtime 07:00 would actually result in using "2012-05-03 06:59:59.999999" as the end date/time, a 48 hour span. To use a 24 hour span the --startdate and --enddate arguments should be the same.

Thinking about it now, this may be too confusing. Perhaps the arguments should be renamed to startoffset and endoffset or something? The behaviour is unintuitive, e.g. an endtime of 23:59 would add almost a full day to the span.

ChickenSupreme commented 4 years ago

I'm going to make it more intuitive, sorry for the spam.