Search code examples
pythonschedule

What timezone is the Python schedule library based on?


The schedule library allows you to schedule jobs at specific times of the day. For example:

schedule.every().day.at("10:30").do(job)

However its documentation doesn't mention the time reference it uses.

Is it based on UTC time?

Or is it based on the time zone of the server that runs my python script?


Solution

  • If you look at the code of the library, you will find that the function datetime.datetime.now() is used (here fore example).

    When looking at the now documentation, you will see that without argument, it is the local time that it is used.

    Thus, schedule.every().day.at("10:30").do(job) will use the server time zone.