Checking Whether Daylight Saving Time Is Currently in Effect : Day Light Saving « Time « Ruby






Checking Whether Daylight Saving Time Is Currently in Effect


puts Time.local(2006, 1, 1)                  # => Sun Jan 01 00:00:00 EST 2006
puts Time.local(2006, 1, 1).isdst            # => false
puts Time.local(2006, 10, 1)                 # => Sun Oct 01 00:00:00 EDT 2006
puts Time.local(2006, 10, 1).isdst           # => true

 








Related examples in the same category

1.Is daylight saving time
2.Is daylight saving time by time zone
3.Except for the Navajo Nation, Arizona doesn't use Daylight Saving Time.
4.restore the original time zone.