Mike Griffin

About | Archives | |

Sequel dates come in two flavours

When you have a datetime field in your database, by default it returns it as a Time object. If you’re using a Ruby version less than 1.9.2, Time has a limited range from 1901 to 2038. If your dates fall outside this range, you will need to set

Sequel.datetime_class = DateTime

before you call

DB = Sequel.odbc('your_odbc_connection', :db_type => 'mssql')

or equivalent.

The error that I was getting was

ArgumentError: argument out of range
    * file: timezones.rb
    * location: local
    * line: 110