小编Ser*_*055的帖子

PytzUsageWarning:zone属性特定于pytz的接口;请迁移到新的时区提供商

我正在编写一个简单的函数,它使用 AsyncIOScheduler 根据计划发送消息。

scheduler = AsyncIOScheduler()
scheduler.add_job(job, "cron", day_of_week="mon-fri", hour = "16")
scheduler.start()
Run Code Online (Sandbox Code Playgroud)

它似乎有效,但我总是收到以下消息:

PytzUsageWarning: The zone attribute is specific to pytz's interface; please migrate to a new time zone provider. For more details on how to do so, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495)
Run Code Online (Sandbox Code Playgroud)

我根本不熟悉 python 中的时间,所以我不太确定这条消息要求我做什么。我访问了消息中提供的链接,但那里的解释对我来说太复杂了。据我了解,我必须迁移到使用 PEP495,但我到底该怎么做呢?

python time scheduler pytz

15
推荐指数
2
解决办法
2万
查看次数

标签 统计

python ×1

pytz ×1

scheduler ×1

time ×1