Closed
Conversation
byroot
reviewed
Apr 1, 2026
| SELECT date_time_test FROM trilogy_test | ||
| SQL | ||
|
|
||
| assert_equal_timestamp time, results[0][0] |
Collaborator
There was a problem hiding this comment.
Interesting. So on an older version, this test would return:
2024-11-03 01:21:54 -0500
But now on main, it returns:
2024-11-03 01:21:54 -0400
So we have a weird off by one error, is that what you mean by "daylight saving" bug? Is that issue only during DLS period? That would suggest rb_time_timespec_new( doesn't handle this correctly?
If we're in need of a quick fix, I suppose we can fallback to creating Time the old way when QUERY_FLAGS_LOCAL_TIMEZONE is set. I suspect most users don't have that flag set.
byroot
pushed a commit
to byroot/trilogy
that referenced
this pull request
Apr 1, 2026
Fix: trilogy-libraries#284 Fix: trilogy-libraries#285 `rb_time_timespec_new` "local time" semantic isn't the same as the Ruby level `Time.local` API. `Time.local` will create a time with the TZ offset relative to that time e.g. a June date will have summer offset regardless of the actual current time. So that `Time.local(2024, 6, 3, 1, 21, 54)` will always return the same thing no matter what. Whereas `rb_time_timespec_new` will use the current offset for that timezone, hence calling the C equivalent of `Time.local(2024, 6, 3, 1, 21, 54)` will return different things over time. Co-Authored-By: Daniel Colson <danieljamescolson@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#284