You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because of the way Ruby handles timezones we can find ourselves in a position where a Time object is non-utc but has a timezone of UTC. If the system timezone utc, we get the following
Because of the way Ruby handles timezones we can find ourselves in a position where a Time object is non-utc but has a timezone of UTC. If the system timezone utc, we get the following
If we use such a time object in calling
local_to_utc
, the is a bug in https://github.com/tzinfo/tzinfo/blob/master/lib/tzinfo/time_or_datetime.rb#L52In that line we check for UTC in the zone. I propose we check the
utc?
method instead of checking thezone
method.The result is that
local_to_utc
may return a non-utc Time object with zone UTC. With the proposed fix we should always be returning a utc Time object.I'm happy to submit the fix. Just wanted some feedback first.
The text was updated successfully, but these errors were encountered: