Skip to content

Tag Archives: Ruby DateTime-class

DateTime#strptime() : strptime() is a DateTime class method which parses the given representation of date and time with the given template Syntax: DateTime.strptime() Parameter: DateTime… Read More
DateTime#rfc822() : rfc822() is a DateTime class method which returns a new DateTime object by parsing from a string according to some typical RFC 2822… Read More
DateTime#civil() : civil() is a DateTime class method which returns a DateTime object denoting the given calendar date. Syntax: DateTime.civil() Parameter: DateTime values Return: DateTime… Read More
DateTime#xmlschema() : xmlschema() is a DateTime class method which returns the XML schema equivalent to strftime(‘%FT%T%:z’) of the DateTime object self. Syntax: DateTime.xmlschema() Parameter: DateTime… Read More
DateTime#to_time() : to_time() is a DateTime class method which returns the time object which denotes the DateTime object self. Syntax: DateTime.to_time() Parameter: DateTime values Return:… Read More
DateTime#to_s() : to_s() is a DateTime class method which returns string representation of the DateTime object. Syntax: DateTime.to_s() Parameter: DateTime values Return: string representation of… Read More
DateTime#to_datetime() : to_datetime() is a DateTime class method which returns the self DateTime object. Syntax: DateTime.to_datetime() Parameter: DateTime values Return: the self DateTime object. Example… Read More
DateTime#zone() : zone() is a DateTime class method which returns the time zone for a given DateTime object. Syntax: DateTime.zone() Parameter: DateTime values Return: the… Read More
DateTime#to_date() : to_date() is a DateTime class method which returns the Date object which denotes itself. Syntax: DateTime.to_date() Parameter: DateTime values Return: the Date object… Read More
DateTime#strftime() : strftime() is a DateTime class method which returns Formats date to the directives in the given format string. Syntax: DateTime.strftime() Parameter: DateTime values… Read More
DateTime#second_fraction() : second_fraction() is a DateTime class method which returns the fractional part of the second.second_fraction. Syntax: DateTime.second_fraction() Parameter: DateTime values Return: the fractional part… Read More
DateTime#sec_fraction() : sec_fraction() is a DateTime class method which returns the fractional part of the second. Syntax: DateTime.sec_fraction() Parameter: DateTime values Return: the fractional part… Read More
DateTime#rfc2822() : rfc2822() is a DateTime class method which returns a new DateTime object by parsing from a string according to some typical RFC 3339… Read More
DateTime#parse() : parse() is a DateTime class method which parses the given representation of date and time, and creates a DateTime object. Syntax: DateTime.parse() Parameter:… Read More
DateTime#ordinal() : ordinal() is a DateTime class method which returns a DateTime object denoting the given ordinal date. Syntax: DateTime.ordinal() Parameter: DateTime values Return: a… Read More

Start Your Coding Journey Now!