-
-
Notifications
You must be signed in to change notification settings - Fork 557
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
Start and end of day incorrect for timezone #117
Comments
Seams to change to the next day at Lunch/Midday it should be switched to midnight maybe? |
Definitely! I thought we had fixed this, but apparently, it persists. The data is likely logged correctly (we store everything in UTC). It's just the web UI that doesn't query the data correctly (for whatever reason doesn't take into account your timezone). I'll take a look at this. |
I think I fixed this issue here: ActivityWatch/aw-webui#49 It'll be included in the next release, thanks for reporting! 😄 |
I'm closing this, please let me know if the new release fixed it for you @johnhamilton! |
This was not fixed. I did some digging and we seem to have slightly deeper problems, but a fix should be easy. Example code: from datetime import datetime, timezone, timedelta
import aw_client
api = aw_client.ActivityWatchClient(testing=True)
buckets = api.get_buckets()
window_bid = next(bid for bid in buckets.keys() if "window" in bid and "testing" not in bid)
print(window_bid)
utcplus2h = timezone(timedelta(hours=2))
start = datetime(year=2017, month=10, day=27, hour=0, tzinfo=utcplus2h)
end = start + timedelta(hours=24)
events = api.get_events(window_bid, start=start, end=end, limit=-1)
print(len(events))
print(events[0].timestamp)
print(events[-1].timestamp) Output:
This output is wrong since the first event should not be from 00:09 UTC, but rather from right after 22:00 UTC. I suspect we are missing a
|
Alright, found the issue and implemented a fix: ActivityWatch/aw-core@b57564c Now we just need to write a datastore tests to ensure it doesn't happen again. |
Wrote a test here: ActivityWatch/aw-core@4b89faf Works great now, closing. |
Problem description
When i start ActivityWatch it shows the wrong day not that current day as its recording today's data for the 15th but its the 16th in Australia and on my computer clock.
What i think the problem is
The code that is recording the the Activity is using a USA data and code showing the page is using the Australia data/my computers data.
The text was updated successfully, but these errors were encountered: