-
Notifications
You must be signed in to change notification settings - Fork 964
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
make datetime objs timezone-aware and UTC default #256
base: master
Are you sure you want to change the base?
Conversation
Hmm, the tests run here fine, and travis seems happy except for 2.7 where it bails with an import error building docs. Got any tips for that? |
If you're going to always use utc for timezone, how about |
* fix mock now() and tests with a timezone * allow flake8-max-line-length to be 90 * fixes for lack of datetime.timezone in python 2.7 (simple UTC) Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
I think I'm pretty much done with this one (pending feedback). Thanks for making me update/add tests and learn something new... ;) |
* requires (assumes) standard config of local system and hw clocks (everything is UTC by default using system TZ offset) Signed-off-by: Steve Arnold <[email protected]>
* for getting logging from the parent package, it needs to specify a logfile/path in logging.basicConfig, import logging, etc Signed-off-by: Steve Arnold <[email protected]>
* rebase of original patch over update-logging patch Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
* use this to enable separate schedule log from parent application "from schedule.parent_logger import setup_logging" Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
* last_run and idle_seconds_since are both None until jobs run once Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Testing 051 pre-release looks good so far; tag for release and shipping on dev...
* requires (assumes) standard config of local system and hw clocks (everything is UTC by default using system TZ offset) Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Testing 051 pre-release looks good so far; tag for release and shipping on dev...
Signed-off-by: Stephen Arnold <[email protected]>
Signed-off-by: Stephen Arnold <[email protected]>
* test coverage is good, test classes need cleanup Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Steve Arnold <[email protected]>
Signed-off-by: Stephen Arnold <[email protected]>
Signed-off-by: Stephen Arnold <[email protected]>
Signed-off-by: Stephen Arnold <[email protected]>
Signed-off-by: Stephen Arnold <[email protected]>
Hmm, this looks okay now, albeit with some extra functionality and reworked tests. Let me know if you'd rather have some squashing and/or more separation. |
Note this is no longer just the timezone-awareness after the recent rebase; it now includes a few extra "features" like a tag parameter and some new job properties. Also includes new tests for the above and green builds on linux/os/x and all the python versions. |
Current totals are:
versus:
|
came here because I was looking for an explicit way to define the timezone. couple nits:
besides this it lgtm |
When will this branch be merged? We need it because it probably fixes the problem we had during the ending of Daylight Saving Time: we schedule jobs to run every minute, but for one hour no jobs are executed because the local time is changed from 3:00 to 2:00. |
|
Yeah can you merge this? I'm trying to schedule something, and can convert the time so that it matches the correct utc time, but I think daylight savings will mess it up |
My new PR #489 is an attempted re-work of this one; if someone could test it, that would be super-helpful. Note my particular need (at the time) was reasonable UTC log times for long-running/daemonized scheduler. Hopefully that still fits someone else's need, otherwise the answer is basically a fully-tzaware scheduler with default/per-job tz attributes (give or take the logging setup). |
(everything is UTC by default using system TZ offset)
After looking through several timezone-related PRs/issues, I think a simple UTC time config is probably the safest default, although it does rely on the system timezone being set. That said, current Linux distros, modern Linux kernels, NTP, etc, are pretty standard. Use as you see fit.