Skip to content

Tag Archives: Ruby Date-class

Date#-() is a Date class method which returns the difference between two dates if the object is date type object. Syntax: Date.-() Parameter: Date values… Read More
Date#day() is a Date class method which returns the day of the month from 1 to 31. Syntax: Date.day() Parameter: Date values Return: the day… Read More
Date#day_fraction() is a Date class method which returns the fractional part of the day. Syntax: Date.day_fraction() Parameter: Date values Return: the fractional part of the… Read More
Date#friday?() is a Date class method which checks whether the date is a Friday. Syntax: Date.friday?() Parameter: Date values Return: true – if the date… Read More
Date#<=> is a Date class method which compares two date objects. Syntax: Date<=>b Parameter: Date values Return: 1 if a is greater than b -1… Read More
Date#ajd() is a Date class method which returns the astronomical Julian day number. Syntax: Date.ajd() Parameter: Date values Return: the astronomical Julian day number. Example… Read More
Date#===() is a Date class method which checks whether the two Date objects are equal. Syntax: Date.===() Parameter: Date values Return: true if two date… Read More
Date#gregorian?() is a Date class method which checks whether the date is on or after the day of calendar reform. Syntax: Date.gregorian?() Parameter: Date values… Read More
Date#<<() is a Date class method which returns the date object pointing ‘n’ (numeric value argument) months before self. Syntax: Date.<<() Parameter: Date values Return:… Read More
Date#gregorian() is a Date class method which returns the gregorian date format. Syntax: Date.gregorian() Parameter: Date values Return: gregorian date format Example #1 : #… Read More
Date#mday() is a Date class method which returns the day of the month from 1 to 31. Syntax: Date.mday() Parameter: Date values Return: day of… Read More
Date#amjd() : amjd() is a Date class method which returns the dastronomical modified Julian day number. Syntax: Date.amjd() Parameter: Date values Return: the dastronomical modified… Read More
Date#asctime() is a Date class method which returns the string in asctime format. It is equivalent to strftime(‘%c’).the dastronomical modified Julian day number. Syntax: Date.asctime()… Read More
Date#ctime() is a Date class method which returns a string in asctime format and is equivalent to strftime(‘%c’). Syntax: Date.ctime() Parameter: Date values Return: a… Read More
Date#cwday() is a Date class method which returns the day of calendar week. Syntax: Date.cwday() Parameter: Date values Return: day of calendar week. Example #1… Read More