class Time

Public Instance Methods

to_date() click to toggle source
# File lib/supplement/date.rb, line 21
def to_date
  jd = Date.civil_to_jd year, mon, mday, Date::ITALY
  hd = Date.jd_to_ajd jd, 0, 0
  Date.new! hd, 0, Date::ITALY
end
to_datetime() click to toggle source
# File lib/supplement/date.rb, line 26
def to_datetime
  jd = DateTime.civil_to_jd year, mon, mday, DateTime::ITALY
  fr = DateTime.time_to_day_fraction hour, min, [sec, 59].min
  fr += (Rational usec, 86400*1000000000)
  of = (Rational utc_offset, 86400)
  hd = DateTime.jd_to_ajd jd, fr, of
  DateTime.new! hd, of, DateTime::ITALY
end
to_time() click to toggle source
# File lib/supplement/date.rb, line 20
def to_time ; self ; end