ajd

d.ajd â rational Instance Public methods Returns the astronomical Julian day number. This is a fractional number, which is not adjusted by the offset. DateTime.new(2001,2,3,4,5,6,'+7').ajd #=> (11769328217/4800) DateTime.new(2001,2,2,14,5,6,'-7').ajd #=> (11769328217/4800)

>>

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

===

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

&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)#=>

&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 ...>

-

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,

+

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-

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 ...>

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.

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.