Skip to content

Commit

Permalink
Work around DateTime.jd fractional second bug on JRuby in named_timez…
Browse files Browse the repository at this point in the history
…ones extension

This switches the code to use DateTime.civil, which does not have
the same bug.
  • Loading branch information
jeremyevans committed Dec 7, 2023
1 parent 0173188 commit aecf741
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
=== master

* Work around DateTime.jd fractional second bug on JRuby in named_timezones extension (jeremyevans)

* Support fractional times and timestamps on SQLAnywhere (jeremyevans)

* Make round_timestamps extension use Dataset#sqltime_precision for rounding Sequel::SQLTime values (jeremyevans)
Expand Down
2 changes: 1 addition & 1 deletion lib/sequel/extensions/named_timezones.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def convert_output_datetime_other(v, output_timezone)
v = output_timezone.utc_to_local(v.new_offset(0))

# Force DateTime output instead of TZInfo::DateTimeWithOffset
DateTime.jd(v.jd, v.hour, v.minute, v.second + v.sec_fraction, v.offset, v.start)
DateTime.civil(v.year, v.month, v.day, v.hour, v.minute, v.second + v.sec_fraction, v.offset, v.start)
end
# :nodoc:
# :nocov:
Expand Down

0 comments on commit aecf741

Please sign in to comment.