diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-09 00:34:17 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-09 00:34:17 +0000 |
commit | 866cba7bb73dcd9d9ae60e8163655295d825dc58 (patch) | |
tree | 66e3b5ffd718e4c041709482108c4722d068060f /activerecord/lib | |
parent | c59bce8596b980535664d0caa5b650384c7a0e91 (diff) | |
download | rails-866cba7bb73dcd9d9ae60e8163655295d825dc58.tar.gz rails-866cba7bb73dcd9d9ae60e8163655295d825dc58.tar.bz2 rails-866cba7bb73dcd9d9ae60e8163655295d825dc58.zip |
DateTimes assume the default timezone. Closes #7764.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6359 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index 0a9049b703..ebde8c83f4 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -118,8 +118,9 @@ module ActiveRecord begin Time.send(Base.default_timezone, *time_array) rescue - # Append zero offset to account for dates skipped by calendar reform. - DateTime.new(*time_array[0..5] << 0 << 0) rescue nil + zone_offset = if Base.default_timezone == :local then DateTime.now.offset else 0 end + # Append zero calendar reform start to account for dates skipped by calendar reform + DateTime.new(*time_array[0..5] << zone_offset << 0) rescue nil end end |