valid_date?

Date.valid_date?(year, month, mday[, start=Date::ITALY]) â bool Class Public methods Returns true if the given calendar date is valid, and false if not. Date.valid_date?(2001,2,3) #=> true Date.valid_date?(2001,2,29) #=> false See also jd and civil.

valid_commercial?

Date.valid_commercial?(cwyear, cweek, cwday[, start=Date::ITALY]) â bool Class Public methods Returns true if the given week date is valid, and false if not. Date.valid_commercial?(2001,5,6) #=> true Date.valid_commercial?(2001,5,8) #=> false See also jd and commercial.

valid_civil?

Date.valid_civil?(year, month, mday[, start=Date::ITALY]) â bool Class Public methods Returns true if the given calendar date is valid, and false if not. Date.valid_date?(2001,2,3) #=> true Date.valid_date?(2001,2,29) #=> false See also jd and civil.

today

Date.today([start=Date::ITALY]) â dateDate.today #=> # Class Public methods Creates a date object denoting the present day.

strptime

Date.strptime([string='-4712-01-01'[, format='%F'[, start=ITALY]]]) â date Class Public methods Parses the given representation of date and time with the given template, and creates a date object. strptime does not support specification of flags and width unlike strftime. Date.strptime('2001-02-03', '%Y-%m-%d') #=> #<Date: 2001-02-03 ...> Date.strptime('03-02-2001', '%d-%m-%Y') #=> #<Date: 2001-02-03 ...> Date.strptime('2001-034', '%Y-%j') #=> #&

rfc822

Date.rfc822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY]) â date Class Public methods Creates a new Date object by parsing from a string according to some typical RFC 2822 formats. Date.rfc2822('Sat, 3 Feb 2001 00:00:00 +0000') #=> #<Date: 2001-02-03 ...>

rfc3339

Date.rfc3339(string='-4712-01-01T00:00:00+00:00'[, start=ITALY]) â date Class Public methods Creates a new Date object by parsing from a string according to some typical RFC 3339 formats. Date.rfc3339('2001-02-03T04:05:06+07:00') #=> #<Date: 2001-02-03 ...>

rfc2822

Date.rfc2822(string='Mon, 1 Jan -4712 00:00:00 +0000'[, start=ITALY]) â date Class Public methods Creates a new Date object by parsing from a string according to some typical RFC 2822 formats. Date.rfc2822('Sat, 3 Feb 2001 00:00:00 +0000') #=> #<Date: 2001-02-03 ...>

parse

Date.parse(string='-4712-01-01'[, comp=true[, start=ITALY]]) â date Class Public methods Parses the given representation of date and time, and creates a date object. This method does not function as a validator. If the optional second argument is true and the detected year is in the range â00â to â99â, considers the year a 2-digit form and makes it full. Date.parse('2001-02-03') #=> #<Date: 2001-02-03 ...> Date.parse('20010203') #=> #<Date: 20

ordinal

Date.ordinal([year=-4712[, yday=1[, start=Date::ITALY]]]) â date Class Public methods Creates a date object denoting the given ordinal date. The day of year should be a negative or a positive number (as a relative day from the end of year when negative). It should not be zero. Date.ordinal(2001) #=> #<Date: 2001-01-01 ...> Date.ordinal(2001,34) #=> #<Date: 2001-02-03 ...> Date.ordinal(2001,-1) #=> #<Date: 2001-12-31 ...> See also jd an