Skip to content
instance method

Time#+

(::Numeric arg0) -> ::Time
self + numeric → new_time

Returns a new Time object whose value is the sum of the numeric value of self and the given numeric:

Example
t = Time.new(2000) # => 2000-01-01 00:00:00 -0600
t + (60 * 60 * 24) # => 2000-01-02 00:00:00 -0600
t + 0.5            # => 2000-01-01 00:00:00.5 -0600

Related: Time#-.

See also .zone_offset #- .xmlschema #<=> also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0