diff --git a/lib/sequel/database/misc.rb b/lib/sequel/database/misc.rb index cdead1e958..3d82c71717 100644 --- a/lib/sequel/database/misc.rb +++ b/lib/sequel/database/misc.rb @@ -169,7 +169,11 @@ def timezone # from the databases's timezone or the default database timezone if # the database does not have a timezone. def to_application_timestamp(v) - Sequel.convert_timestamp(v, timezone) + if v.is_a? String && v.length >= 19 + Time.utc(v[0,4], v[5,7], v[8,10], v[11,13], v[14,16], v[17,19]) + else + Sequel.convert_timestamp(v, timezone) + end end # Typecast the value to the given column_type. Calls