Skip to content

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

instance method

Date#jd

d.jd → integer

Returns the 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').jd      #=> 2451944
DateTime.new(2001,2,3,4,5,6,'-7').jd      #=> 2451944
See also .jd #italy #jisx0301 #iso8601 also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1