Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Date#jd

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