APIdock / Ruby
/
Browse About
method

mjd

v2_6_3 - Show latest stable - Class: Date
mjd()
public

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

DateTime.new(2001,2,3,4,5,6,'+7').mjd     #=> 51943
DateTime.new(2001,2,3,4,5,6,'-7').mjd     #=> 51943
static VALUE
d_lite_mjd(VALUE self)
{
    get_d1(self);
    return f_sub(m_real_local_jd(dat), INT2FIX(2400001));
}

Related methods

  • Instance methods
  • +
  • -
  • <<
  • <=>
  • ===
  • >>
  • ajd
  • amjd
  • as_json
  • asctime
  • ctime
  • cwday
  • cweek
  • cwyear
  • day
  • day_fraction
  • downto
  • england
  • eql?
  • fill
  • friday?
  • gregorian
  • gregorian?
  • hash
  • httpdate
  • initialize_copy
  • inspect
  • inspect_raw
  • iso8601
  • italy
  • jd
  • jisx0301
  • julian
  • julian?
  • ld
  • leap?
  • marshal_dump
  • marshal_dump_old
  • marshal_load
  • mday
  • mjd
  • mon
  • monday?
  • month
  • new_start
  • next
  • next_day
  • next_month
  • next_year
  • nth_kday?
  • prev_day
  • prev_month
  • prev_year
  • rfc2822
  • rfc3339
  • rfc822
  • saturday?
  • start
  • step
  • strftime
  • succ
  • sunday?
  • thursday?
  • to_date
  • to_datetime
  • to_json
  • to_s
  • to_time
  • tuesday?
  • upto
  • wday
  • wednesday?
  • xmlschema
  • yday
  • year
  • Class methods
  • _httpdate
  • _iso8601
  • _jisx0301
  • _load
  • _parse
  • _rfc2822
  • _rfc3339
  • _rfc822
  • _strptime
  • _xmlschema
  • civil
  • commercial
  • gregorian_leap?
  • httpdate
  • iso8601
  • jd
  • jisx0301
  • json_create
  • julian_leap?
  • leap?
  • new
  • new!
  • nth_kday
  • ordinal
  • parse
  • rfc2822
  • rfc3339
  • rfc822
  • strptime
  • test_all
  • test_civil
  • test_commercial
  • test_nth_kday
  • test_ordinal
  • test_unit_conv
  • test_weeknum
  • today
  • valid_civil?
  • valid_commercial?
  • valid_date?
  • valid_jd?
  • valid_ordinal?
  • weeknum
  • xmlschema
  • Private methods
  • privatehour
  • privatemin
  • privateminute
  • privatesec
  • privatesecond
  • privatewnum0
  • privatewnum1
APIdock API Documentation Browser

© 2026 APIdock