datetime_parse_to_time.rb

lib/sequel/extensions/datetime_parse_to_time.rb
Last Update: 2021-12-17 16:59:47 -0800

This switches the default parsing of strings into Time values from using Time.parse to using DateTime.parse.to_time. This fixes issues when the times being parsed have no timezone information, the implicit timezone for the Database instance is set to :utc, and the timestamps being used include values not valid in the local timezone, such as during a daylight savings time switch.

To load the extension:

Sequel.extension :datetime_parse_to_time