Sha256: d2de10f35a45710cb04f38634c04e8a5ffc99ca7bced653262675d0ac5bab941
Contents?: true
Size: 508 Bytes
Versions: 21
Compression:
Stored size: 508 Bytes
Contents
class Time unless method_defined?(:to_date) # Backported from Ruby 1.9. def to_date 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 end end class Date unless method_defined?(:to_date) # Backported from Ruby 1.9. def to_date self end end unless method_defined?(:to_time) # Backported from Ruby 1.9. def to_time Time.local(year, mon, mday) end end end
Version data entries
21 entries across 21 versions & 6 rubygems