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

Issue with timezone/ linux #592

Closed
dshetyo opened this issue Jul 14, 2023 · 1 comment
Closed

Issue with timezone/ linux #592

dshetyo opened this issue Jul 14, 2023 · 1 comment

Comments

@dshetyo
Copy link

dshetyo commented Jul 14, 2023

I am using following code to schedule a function in EST time zone.

The function is scheduled on time on windows machine whose timezone is PST.
The function is NOT scheduled on time on linux machine (GCP cloud) whose timezone is UTC.

When I say on time i mean 9:45 EST. I want to function to be scheduled at 9:45 EST irrespective of machine timezone.

def run_live_traders_in_parallel() (self):
    print(f"hello {datetime.datetime.now()}")

def schedule_job(self):
    print(f"schedules jobs")
    schedule.every().day.at("09:45", "US/Eastern").do(self.run_live_traders_in_parallel)

    while True:
        schedule.run_pending()
        print("Scheduled jobs:", schedule.jobs)
        time.sleep(1)
OP from linux machine which is in UTC
 print("Scheduled jobs:", schedule.jobs)
Scheduled jobs: [Every 1 day at 09:45:00 do run_live_traders_in_parallel() (last run: [never], next run: 2023-07-15 13:45:00)

What can be a potential issue?

SijmenHuizenga added a commit to SijmenHuizenga/schedule that referenced this issue Oct 1, 2023
@SijmenHuizenga
Copy link
Collaborator

Resolved with #583 and released in 1.2.1. I am also adding a test to cover your specific case in #602. Cheers!

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