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_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_jd?

Date.valid_jd?(jd[, start=Date::ITALY]) â bool Class Public methods Just returns true. It's nonsense, but is for symmetry. Date.valid_jd?(2451944) #=> true See also jd.

valid_ordinal?

Date.valid_ordinal?(year, yday[, start=Date::ITALY]) â bool Class Public methods Returns true if the given ordinal date is valid, and false if not. Date.valid_ordinal?(2001,34) #=> true Date.valid_ordinal?(2001,366) #=> false See also jd and ordinal.

xmlschema

Date.xmlschema(string='-4712-01-01'[, start=ITALY]) â date Class Public methods Creates a new Date object by parsing from a string according to some typical XML Schema formats. Date.xmlschema('2001-02-03') #=> #<Date: 2001-02-03 ...>

+

d + other â date Instance Public methods Returns a date object pointing other days after self. The other should be a numeric value. If the other is flonum, assumes its precision is at most nanosecond. Date.new(2001,2,3) + 1 #=> #<Date: 2001-02-04 ...> DateTime.new(2001,2,3) + Rational(1,2) #=> #<DateTime: 2001-02-03T12:00:00+00:00 ...> DateTime.new(2001,2,3) + Rational(-1,2) #=> #<DateTime: 2001-02-

-

d - other â date or rational Instance Public methods Returns the difference between the two dates if the other is a date object. If the other is a numeric value, returns a date object pointing other days before self. If the other is flonum, assumes its precision is at most nanosecond. Date.new(2001,2,3) - 1 #=> #<Date: 2001-02-02 ...> DateTime.new(2001,2,3) - Rational(1,2) #=> #<DateTime: 2001-02-02T12:00:00+00:00 ...> Date.new(2001,

&lt;&lt;

d Instance Public methods Returns a date object pointing n months before self. The n should be a numeric value. Date.new(2001,2,3) << 1 #=> #<Date: 2001-01-03 ...> Date.new(2001,1,31) << 11 #=> #<Date: 2000-02-29 ...> Date.new(2001,2,3) << -1 #=> #<Date: 2001-03-03 ...>

&lt;=&gt;

d other â -1, 0, +1 or nil Instance Public methods Compares the two dates and returns -1, zero, 1 or nil. The other should be a date object or a numeric value as an astronomical Julian day number. Date.new(2001,2,3) <=> Date.new(2001,2,4) #=> -1 Date.new(2001,2,3) <=> Date.new(2001,2,3) #=> 0 Date.new(2001,2,3) <=> Date.new(2001,2,2) #=> 1 Date.new(2001,2,3) <=> Object.new #=> nil Date.new(2001,2,3) <=> Rational(4903887,2)#=>

===

d === other â bool Instance Public methods Returns true if they are the same day. Date.new(2001,2,3) === Date.new(2001,2,3) #=> true Date.new(2001,2,3) === Date.new(2001,2,4) #=> false DateTime.new(2001,2,3) === DateTime.new(2001,2,3,12) #=> true DateTime.new(2001,2,3) === DateTime.new(2001,2,3,0,0,0,'+24:00') #=> true DateTime.new(2