Class: Time
Class Method Summary collapse
-
.random(start_time, end_time = Time.now) ⇒ Object
Generates a random Time between the start time and the end time.
Instance Method Summary collapse
Class Method Details
Instance Method Details
#to_date ⇒ Object
7 8 9 10 11 |
# File 'lib/mack-facets/extensions/time.rb', line 7 def to_date require 'date' # just in case jd = Date.__send__(:civil_to_jd, year, mon, mday, Date::ITALY) Date.new!(Date.__send__(:jd_to_ajd, jd, 0, 0), 0, Date::ITALY) end |
#to_datetime ⇒ Object
19 20 21 |
# File 'lib/mack-facets/extensions/time.rb', line 19 def to_datetime raise NoMethodError.new("to_datetime") end |