aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/values/time_zone.rb
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-03-11 04:26:20 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-03-11 04:26:20 +0000
commit52b57c662c129d72d44fa1ab9920a752c1973482 (patch)
tree90e89994fc4486e5523fe45df46f5d013e184a83 /activesupport/lib/active_support/values/time_zone.rb
parent3d2177df26c8934320277a7aed84595decd94662 (diff)
downloadrails-52b57c662c129d72d44fa1ab9920a752c1973482.tar.gz
rails-52b57c662c129d72d44fa1ab9920a752c1973482.tar.bz2
rails-52b57c662c129d72d44fa1ab9920a752c1973482.zip
TimeWithZone instances correctly enforce DST rules. Adding TimeZone#period_for_utc
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9006 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/values/time_zone.rb')
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb
index 4f2fc5e44b..ced823f052 100644
--- a/activesupport/lib/active_support/values/time_zone.rb
+++ b/activesupport/lib/active_support/values/time_zone.rb
@@ -212,6 +212,11 @@ class TimeZone
end
# Available so that TimeZone instances respond like TZInfo::Timezone instances
+ def period_for_utc(time)
+ tzinfo.period_for_utc(time)
+ end
+
+ # Available so that TimeZone instances respond like TZInfo::Timezone instances
def period_for_local(time, dst=true)
tzinfo.period_for_local(time, dst)
end