I am building a plugin that needs the time of the user. I know we get the iso code in the request header, but converting the hundreds of ISO codes to timezones seemed like a poor work around to me (would love to be told that it is not a poor workaround ). I have not found or thought of an elegent solution of going from ISO codes to timezones.
However I am able to get the timezone from the browser on sign up in the oauth workflow using
const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
But if I use this value and the user changes time zones or the browser api is incorrect then the user will always have incorrect time, since plugin sign-in only happens once.
Please let me know if we can add this to the request header, if not, anyone have any solutions how I can manager global users and user timezones? I can use the timezone data I have for now, but I will not be covering the case where the timezone data is out of date due to the user moving.