Skip to content
instance method

Time#dst?

() -> bool
dst? → true or false

Alias of #isdst

Returns true if self is in daylight saving time, false otherwise:

Example
t = Time.local(2000, 1, 1) # => 2000-01-01 00:00:00 -0600
t.zone                     # => "Central Standard Time"
t.dst?                     # => false
t = Time.local(2000, 7, 1) # => 2000-07-01 00:00:00 -0500
t.zone                     # => "Central Daylight Time"
t.dst?                     # => true
See also #isdst #deconstruct_keys #eql? #day also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0