Skip to content

Tag Archives: Ruby Time-class

Time#gmt_offset() is a Time class method which returns the offset in seconds between the timezone of UTC and time. Syntax: Time.gmt_offset() Parameter: Time values Return:… Read More
Time#to_datetime() is a Time class method which returns a date time object of itself. Syntax: Time.to_datetime() Parameter: Time values Return: a date time object of… Read More
Time#utc?() : utc?() is a Time class method which checks whether the time is a conversion to UTC (GMT), modifying the receiver. Syntax: Time.utc?() Parameter:… Read More
Time#sec() is a Time class method which returns the second of the minute from 0 to 60 for time. Syntax: Time.sec() Parameter: Time values Return:… Read More
Time#utc() : utc() is a Time class method which returns the conversion of time to UTC (GMT), modifying the receiver. Syntax: Time.utc() Parameter: Time values… Read More
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… Read More
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 :… Read More
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… Read More
Time#usec() is a Time class method which returns the number of microseconds for time. Syntax: Time.usec() Parameter: Time values Return: the number of microseconds for… Read More
Time#to_a() is a Time class method which returns the string which returns a ten-element array of values for time. Format [sec, min, hour, day, month,… Read More
Time#tv_usec() is a Time class method which returns the number of microseconds for time. Syntax: Time.tv_usec() Parameter: Time values Return: the number of microseconds for… Read More
The + is an inbuilt method in Ruby returns a time after adding given time in seconds Syntax: time + Parameters: The function accepts no… Read More
The is an inbuilt method in Ruby returns -1, 0, 1 depending on whether time is less than, equal to, or greater than other time.… Read More
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:… Read More
The ctime() is an inbuilt method in Ruby returns a canonical string representation of time. Syntax: time.ctime() Parameters: The function accepts no parameter Return Value:… Read More