I am retrieving the stream schedule of various channels via the API, using the helix/schedule/icalendar-endpoint. Each event then contains the dtStart and dtEnd-parameters, containing the start and end time.
However, against what I was expecting (and what various sources only assume as well), the timestamps retrieved by the API are not in UTC. E.g this is the return I receive for Critical Role:
For a channel in my own timezone, the values obviously match up, not that it’s relevant really.
The issue I am having is that I simply do not know how to convert from Arbitrary TimezoneX to Arbitrary TimezoneY, or to the local timezone (without hardcoding it in, I mean, which while possible is not really a solution to this issue.)
And thus, I am kinda stuck.
Is this known behaviour, or should I have received UTC-formatted timestamps? Does anyone have any tips?
pass it into an iCal parsing library for your programming langauge of choice
Which is what any calendar system does (like google calendar) when you feed it the iCal URL.
Which evidently does not appear to be the case for google cal - it converts these timestamps neither to UTC, nor to the timezone set in its own settings. Not sure why - as there’s no reason for it not to, and plenty for it to do so, but that is evidently the case here, as shown above. ¯\_(ツ)_/¯