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?
Use a time parsing library for your programming language of choice.
Or since you are pulling the iCal feed, 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.
so
DSTAMP is the time this iCal was generated. The Z specifies Zulu aka UTC
Start/endd
Decalres the Timezone, New York, and it’s 2022 11 17 Time 19:00:00 thru 23:00:00 (New York Time)
This is according to the iCal speficiation. So no, not a unix timestamp.
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. ¯\_(ツ)_/¯