Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Date#mjd

d.mjd → integer

Returns the modified Julian day number. This is a whole number, which is adjusted by the offset as the local time.

Example
DateTime.new(2001,2,3,4,5,6,'+7').mjd     #=> 51943
DateTime.new(2001,2,3,4,5,6,'-7').mjd     #=> 51943
See also #mday #mon #leap? #monday? also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0