-
Beta Was this translation helpful? Give feedback.
Answered by
Rapptz
Aug 29, 2023
Replies: 2 comments 1 reply
-
The |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is an issue with timezones. Naive times for the task extension are interpreted as UTC time, local_tz = datetime.datetime.now().astimezone().tzinfo
goodNightTime = datetime.time(hour=19, minute=46, tzinfo=local_tz) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Nalanii
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an issue with timezones. Naive times for the task extension are interpreted as UTC time,
datetime.datetime.now()
is a naive datetime representing local time. In order to make your datetime proper you need to make it an aware time for your local timezone. Usingastimezone()
is enough for that. e.g.