datetime_parse_to_time.rb

Path: lib/sequel/extensions/datetime_parse_to_time.rb
Last Update: Sat Jun 02 02:04:22 +0000 2018

frozen-string-literal: true

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

[Validate]