-
Notifications
You must be signed in to change notification settings - Fork 948
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
Negative idle time when using a time-zone different from host machine #582
Comments
AnezeR
changed the title
Negative idle time when using time-zones
Negative idle time when using a time-zone different from host machine
Apr 27, 2023
I think the issue is in this block Lines 752 to 771 in a3c2074
It subtracts one day if self.at_time is greater than now(): Line 768 in a3c2074
But, since self.at_time is not updated inLines 752 to 759 in a3c2074
It still executes. E.G. If the machine uses UTC time and execution time is 20:00 in UTC+3, self.next_run would change to 17:00 UTC, while self.at_time would stay at 20:00. Now, if the machine time is 19:00 UTC, it should not subtract a day, since it is already 2 hours past execution time, but, it would see, that 19:00 is less than 20:00 and subtract a day from self.next_run |
Thank you so much for investigating and creating a pr! #583 has been merged and released in 1.2.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
local python version: 3.9.16
docker python: python:3.9-slim-buster
schedule==1.2.0
pytz==2023.3
I have this code, which I run inside a docker container
In this case it outputs negative time and would attempt to run
send_practice_notifications
, which I want to happen only at specified time, and not every time the program starts.When run natively, however, it outputs a positive expected value and does not run any functions.
30777.206617
I think this is an error related to time-zones because docker container uses UTC time, and running natively puts it in the Europe/Moscow timezone.
Sure enough, changing the code in docker to
Makes the output positive and expected
1709.825228
The text was updated successfully, but these errors were encountered: