Skip to content
instance method

Time#isdst

() -> bool
dst? -> true or false

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 #inspect #iso8601 #httpdate #localtime also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0