Pycronofy 时区 ID 设置不正确

Pycronofy timezone id not being set correctly

正在尝试整合 Cronofy to an app using the Python package pycronofy

但似乎无法在正确的时区返回结果,即使在按要求设置后也是如此。

events = cronofy.read_events(calendar_ids=('CAL_ID',),from_date=from_date, to_date=to_date, tzid='Asia/Kolkata')

print (events.json())

返回的 json 总是在 UTC 时区。这个库似乎没有 SO 标签,但希望有人能提供帮助。

tzid参数与请求的事件限制有关,要在响应中获取更丰富的时间信息需要请求localized_times:

events = cronofy.read_events(calendar_ids=('CAL_ID',),
                             from_date=from_date,
                             to_date=to_date,
                             tzid='Asia/Kolkata',
                             localized_times=True)