Skip to content

Commit

Permalink
fix(example): fixed tz-naive datetimes in time_spent_today.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare authored May 24, 2024
1 parent c699f43 commit ff61703
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions examples/time_spent_today.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# NOTE: Might not treat timezones correctly.

from datetime import datetime, time, timedelta
from datetime import datetime, time, timedelta, timezone
import socket

import aw_client

if __name__ == "__main__":
# Set this to your AFK bucket
bucket_id = f"aw-watcher-afk_{socket.gethostname()}"

daystart = datetime.combine(datetime.now().date(), time())
daystart = datetime.combine(datetime.now().date(), time()).astimezone(timezone.utc)
dayend = daystart + timedelta(days=1)

awc = aw_client.ActivityWatchClient("testclient")
Expand Down

0 comments on commit ff61703

Please sign in to comment.