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

Is this incorrect time calculation? #212

Open
thevikas opened this issue May 20, 2021 · 1 comment
Open

Is this incorrect time calculation? #212

thevikas opened this issue May 20, 2021 · 1 comment

Comments

@thevikas
Copy link
Contributor

My gtime conf:

[gtimelog]
virtual_midnight = 03:00
report_style = categorized
edit_tasklist_cmd = /usr/local/bin/code
spreasheet =/usr/local/bin/code
editor = /usr/local/bin/code
mailer = /usr/local/bin/code

A snip of the timelog:

2021-04-21 14:26: xx3: loading VM
2021-04-21 15:21: xx2: meeting
2021-04-21 16:15: xx3: meeting
2021-04-21 18:50: away **
2021-04-21 18:50: xx3: meeting
2021-04-21 20:46: away **
2021-04-21 20:46: xx3: meeting
2021-04-21 23:04: personal: cleanup
2021-04-21 23:15: personal: cleanup
2021-04-21 23:20: pwx: server

2021-04-22 15:55: pwx: server
2021-04-22 22:56: away **
2021-04-22 22:56: pwx: server
2021-04-22 22:58: away **
2021-04-22 22:58: pwx: server
2021-04-22 23:07: pwx: server

2021-04-23 02:54: away **
2021-04-23 02:54: pwx: server
2021-04-23 03:04: pwx: server
2021-04-23 13:44: xxx1: xxx2
2021-04-23 14:20: xx2: meeting
2021-04-23 18:56: away **
2021-04-23 18:56: xx2: meeting
2021-04-23 19:18: xx2: migration
2021-04-23 20:18: xx2: migration
2021-04-23 21:08: xx3: reading docs

pwx: server total in the report is 0:14. While it seems should be 0:24. Is this a incorrect time calculation or is it due to virtual midnight affecting?

@mgedmin
Copy link
Member

mgedmin commented May 20, 2021

Yes, the blank lines in your log are inconsistent with the virtual_midnight setting.

The first entry after virtual_midnight gets an implicit **, so gtimelog thinks that you started work on the 23rd at 03:04 AM.

I have vague plans of making gtimelog warn about this, and also I have plans to change the timelog format so that it records historical values of virtual_midnight in comments so that parsing an old log wouldn't change if you adjust the virtual_midnight setting.

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

No branches or pull requests

2 participants