Method: ActiveSupport::TimeWithZone#dst?

Defined in:
lib/active_support/time_with_zone.rb

#dst?Boolean Also known as: isdst

Returns true if 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

Returns:

  • (Boolean)


104
105
106
# File 'lib/active_support/time_with_zone.rb', line 104

def dst?
  period.dst?
end