Class Time
In: lib/ruby_units/time.rb
Parent: Object

Time math is handled slightly differently. The difference is considered to be an exact duration if the subtracted value is in hours, minutes, or seconds. It is rounded to the nearest day if the offset is in years, decades, or centuries. This leads to less precise values, but ones that match the calendar better.

Methods

+   -   at   in   to_date   to_datetime   to_unit   u   unit  

External Aliases

at -> unit_time_at
+ -> unit_add
- -> unit_sub

Public Class methods

usage: Time.in ‘5 min’

Public Instance methods

u(other = nil)

Alias for to_unit

unit(other = nil)

Alias for to_unit

[Validate]