dbader / schedule

Python job scheduling for humans.
https://schedule.readthedocs.io/
MIT License
11.73k stars 959 forks source link

new utc baseline for (old) schedule PR, make some datetime objs tzaware #489

Open sarnold opened 2 years ago

sarnold commented 2 years ago

Minimal rework of https://github.com/dbader/schedule/pull/256 <= that needs use-case testing by interested parties. When I used the old version of ^^ that PR I had to setup the logging to use time.gmtime to get the right (UTC) log times, however, in newer py3 versions you can use https://docs.python.org/3/library/logging.html?highlight=logging%20time#logging.Formatter.formatTime (note the note about py3.9)

Hopefully someone finds this useful; I just don't have time right now to go back to my old project and try upgrading, etc. Enjoy!

Setting TZ environment var in runtime may be required (also a good idea)

schedule/test changes:

samgermain commented 2 years ago

@dbader Please review this