Ruby | Time dst?() function Last Updated : 07 Jan, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The dst?() is an inbuilt method in Ruby returns true if time occurs during Daylight Saving Time in its time zone otherwise false Syntax: time.dst?() Parameters: The function accepts no parameter Return Value: It returns true if time occurs during Daylight Saving Time in its time zone otherwise false Example 1: CPP # Ruby code for dst?() method # Include Time require 'time' # Declaring time a = Time.new(2000, 12, 23) # Prints boolean value puts a.dst?() Output: false Example 2: CPP # Ruby code for dst?() method # Include Time require 'time' # Declaring time a = Time.now() # Prints boolean value puts a.dst?() Output: false Comment More infoAdvertise with us Next Article Ruby | Time dst?() function G gopaldave Follow Improve Article Tags : Ruby Ruby-Methods Ruby Time-class Similar Reads Ruby | Time day() function The day() is an inbuilt method in Ruby returns the day of the month for time. Syntax: time.day() Parameters: The function accepts no parameter Return Value: It returns the day of the month for time. Example 1: CPP # Ruby code for day() method # Include Time require 'time' # Declaring time a = Time.n 1 min read Ruby | Time - function Time#-() is a Time class method which returns a new time value after subtracting seconds from it. Syntax: Time.-() Parameter: Time values Return: new time value after subtracting seconds from it. Example #1 : Ruby # Ruby code for Time.-() method # declaring time a = Time.new(2019) # declaring time b 2 min read Ruby | Time + function Time#+() is a Time class method which returns a new time value after adding seconds to it. Syntax: Time.+() Parameter: Time values Return: new time value after adding seconds to it Example #1 : Ruby # Ruby code for Time.+() method # declaring time a = Time.new(2019) # declaring time b = Time.new(201 2 min read Ruby | Time to_date() function Time#to_date() is a Time class method which returns a self Date object. Syntax: Time.to_date() Parameter: Time values Return: a self Date object. Example #1 : Ruby # Ruby code for Time.to_date() method # loading library require 'time' # declaring time a = Time.new(2019) # declaring time b = Time.new 2 min read Ruby | Time asctime() function The asctime() is an inbuilt method in Ruby returns a canonical string representation of time. Syntax: time.asctime() Parameters: The function accepts no parameter Return Value: It returns a canonical string representation of time. Example 1: CPP # Ruby code for asctime() method # Include Time requir 1 min read Like