I have a device reporting data already based on the time zone. I want to convert to UTC but I am in Chicago/USA time zone so the offset switches from -5 to -6 depending on the time of year. So i tried using the dayjs.tz but that doesn’t seem possible?
I get this error: Function Parse Error: Error:1:15197 ‘Intl’ is not defined at (module_dayjs:1:15197) at v (module_dayjs:1:15100) at M (module_dayjs:1:15427) at (module_dayjs:1:16443) at convertChicagoToUTCISO8601 (device_payload_parser:11:16) at (device_payload_parser:37:32) at reduce (native) at (device_payload_parser:95:32)
If you’re storing your data using a ISO-String which already contains the timezone, it will be automatically converted to UTC applying the correct offset based on the time of the year. Converting to a valid ISO-String is usually the easiest approach if you’re not doing it already.
Regarding using DayJS library, it was supposed to work the way you described. I’ve opened a ticket internally for our team to investigate why Dayjs.tz is not working properly.