Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time zone changes not supported #10

Closed
kitchoi opened this issue Aug 21, 2018 · 3 comments · Fixed by #11
Closed

Time zone changes not supported #10

kitchoi opened this issue Aug 21, 2018 · 3 comments · Fixed by #11

Comments

@kitchoi
Copy link
Contributor

kitchoi commented Aug 21, 2018

When one travels to another time zone, they can get the following error when getting a report:

Traceback (most recent call last):
  File "/usr/local/bin/utt", line 11, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/utt/__main__.py", line 46, in main
    handler(args)
  File "/Library/Python/2.7/site-packages/utt/cmd_report.py", line 42, in execute
    report_date, util.entries_from_file(args.data_filename))
  File "/Library/Python/2.7/site-packages/utt/cmd_report.py", line 88, in _filter_and_group_entries
    all_entries))
  File "/Library/Python/2.7/site-packages/utt/util.py", line 40, in entries_from_file
    (i, previous_entry, new_entry))
Exception: Error line 44. Not in chronological order: 2018-08-07 19:49 break** > 2018-08-07 19:35 project

If the latter entry was logged 14 minutes later, the error would not happen and the report would be wrong, with or without the user noticing it.

I would propose logging with time zones. For backward compatibility (and for those who never cares), timestamps without time zones will be treated in local time zone. Would that be okay? I can open a pull request to fix this. My colleagues and I travel a lot as part of our job.

@larose
Copy link
Owner

larose commented Aug 30, 2018

Sounds good to me. Let's finish #9 first though.

@larose
Copy link
Owner

larose commented Aug 31, 2018

Let's put this on hold. I need to think about it.

@kitchoi
Copy link
Contributor Author

kitchoi commented Sep 8, 2018

@larose I only saw your above comment when I was ready to push (#11). It would be good to know your thoughts on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants