Anupam
Anupam

Reputation: 15620

Pycronofy timezone id not being set correctly

Trying to integrate Cronofy to an app using the Python package pycronofy.

But cant seem to get the results back in the right timezone even after setting it as required.

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

print (events.json())

The returning json is always in the UTC timezone. This library doesnt seem to have an SO tag but hoping that someone could help.

Upvotes: 1

Views: 42

Answers (1)

Garry Shutler
Garry Shutler

Reputation: 32698

The tzid parameter relates to the restriction of events for the request, to get richer time information in the response you need to request localized_times:

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

Upvotes: 1

Related Questions