Skip to content
Browse files

Add documentation for the TimeWithZone#dst? method.

[ci skip]
  • Loading branch information...
1 parent 3511e3f commit 6d5385a1354a8bec2ac522693c1173e547ffd61e @MattStopa MattStopa committed Dec 31, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 activesupport/lib/active_support/time_with_zone.rb
View
6 activesupport/lib/active_support/time_with_zone.rb
@@ -80,6 +80,12 @@ def localtime
end
alias_method :getlocal, :localtime
+ # Returns true if the the current time is within Daylight Savings Time for the
+ # specified time zone.
+ #
+ # Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)'
+ # Time.zone.parse("2012-5-30").dst? # => true
+ # Time.zone.parse("2012-11-30").dst? # => false
def dst?
period.dst?
end

0 comments on commit 6d5385a

Please sign in to comment.
Something went wrong with that request. Please try again.