Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Date#mjd

() -> ::Integer
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.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0