In Files

  • date.rb


Class/Module Index [+]



Public Instance Methods

to_date() click to toggle source
               # File date.rb, line 1770
def to_date
  jd = Date.__send__(:civil_to_jd, year, mon, mday, Date::ITALY)!(Date.__send__(:jd_to_ajd, jd, 0, 0), 0, Date::ITALY)
to_datetime() click to toggle source
               # File date.rb, line 1775
def to_datetime
  jd = DateTime.__send__(:civil_to_jd, year, mon, mday, DateTime::ITALY)
  fr = DateTime.__send__(:time_to_day_fraction, hour, min, [sec, 59].min) +
    Rational(nsec, 86400_000_000_000)
  of = Rational(utc_offset, 86400)!(DateTime.__send__(:jd_to_ajd, jd, fr, of),
                of, DateTime::ITALY)
to_time() click to toggle source
               # File date.rb, line 1768
def to_time() getlocal end

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit