The frontend requests /api/users/me.json to get the user's timezone offset. We were calculating that offset using rails' ActiveSupport::TimeZone#formatted_offset method. However, this is just an abstract zone like "America/New_York" where the offset changes with the switch to daylight savings time. A single offset doesn't make sense!
Instead, we want to ask what is the offset right now by calling #now on the time zone then calling formatted_offset on that. This knows how to adjust the offset based on the presence or absence of daylight savings time.
The frontend requests `/api/users/me.json` to get the user's timezone offset. We were calculating that offset using rails' [`ActiveSupport::TimeZone#formatted_offset`][zone_offset] method. However, this is just an abstract zone like "America/New_York" where the offset changes with the switch to daylight savings time. A single offset doesn't make sense!
Instead, we want to ask what is the offset _right now_ by calling `#now` on the time zone then calling [`formatted_offset`][time_offset] on that. This knows how to adjust the offset based on the presence or absence of daylight savings time.
[zone_offset]: https://api.rubyonrails.org/v7.1/classes/ActiveSupport/TimeZone.html#method-i-formatted_offset
[time_offset]: https://api.rubyonrails.org/v7.1/classes/ActiveSupport/TimeWithZone.html#method-i-formatted_offset