New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time object's offset gets screwed up in certain circumstances #6651
Comments
|
This is another manifestation of #4847. |
|
Basically |
|
So I think there's at least four methods where this bug manifests:
I'm going to just look at Time#+ for now because I have a suspicion that it does come down to Time#change but I want to be sure. So here's how that works:
Let's take some cases:
So it does come down to Time#change: |
|
And Time#change does this:
So it seems to come down to either Time.time_with_datetime_fallback, or DateTime.civil_from_format. I'm not sure why either of these exist. If you want to build a time in a time zone, it seems like you should be able to just do one of:
and boom, you're done. @pixeltrix you mentioned there's some 1.8-compat stuff here, what is that? |
|
Closed by 98b46bf |
Ruby's
Time#getlocaltakes a UTC offset and returns a time object with an adjusted UTC offset (but no named zone). Such objects have funny behavior in the following circumstances when interacting with ActiveSupport functionality+method:changemethod:The text was updated successfully, but these errors were encountered: