timezone issue for scheduler
See original GitHub issuesample code from apscheduler docs:
from pytz import utc
....
scheduler = BackgroundScheduler(jobstores=jobstores, executors=executors, job_defaults=job_defaults, timezone=utc)
it works for ubuntu, but after I change OS to amazonlinux, does not work error message:
ERROR:apscheduler.jobstores.default:Unable to restore job "xxxx_job" -- removing it
Traceback (most recent call last):
File "/usr/local/lib64/python2.7/site-packages/apscheduler/jobstores/sqlalchemy.py", line 141, in _get_jobs
jobs.append(self._reconstitute_job(row.job_state))
File "/usr/local/lib64/python2.7/site-packages/apscheduler/jobstores/sqlalchemy.py", line 125, in _reconstitute_job
job_state = pickle.loads(job_state)
File "/usr/local/lib/python2.7/site-packages/pytz/__init__.py", line 283, in _p
return unpickler(*args)
File "/usr/local/lib/python2.7/site-packages/pytz/tzinfo.py", line 539, in unpickler
tz = pytz.timezone(zone)
File "/usr/local/lib/python2.7/site-packages/pytz/__init__.py", line 177, in timezone
raise UnknownTimeZoneError(zone)
UnknownTimeZoneError: 'local'
then I add a file /etc/timezone with content ‘Etc/UTC’, it works
when add a scheduled job, should it use timezone I passed in code otherwise read from /etc/timezone ? looks like it always get it from system config
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Understanding the timezone when scheduling a meeting in ...
Users encountered the following issues when scheduling a RingCentral Meeting session from the RingCentral app: The timezone is different from ...
Read more >Weekday use different Timezone · Issue #226 - GitHub
I have instances launched in us-east-2 region would like to use the aws-instance-scheduler stack launched in ap-southeast-2. I created a period
Read more >Letting users choose timezone for scheduling system
How to design when users are from different timezones? Store datetime in UTC in your database. After users signup, when they login to...
Read more >Job Scheduler Time Zone Issue | Support Center
Job Scheduled to run in BST Time zone is not running at the correct BST time. Job Scheduled to Run at 12.30 AM...
Read more >Scheduled Task/Timezone Bug in all RTM Windows 10 ...
The workaround here, is to set the timezone to manual time, in a timezone that is a whole number offset, and then adjust...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
pass timezone=utc to BackgroundScheduler like this:
As for the first observed problem, it happened while restoring an existing job. The timezone you set for the scheduler does not affect jobs added before that. So, not a bug. As for the second, report that to the tzlocal issue tracker.