Skip to content
instance method

Time#sec

() -> ::Integer
sec → integer

Returns the integer second of the minute for self, in range (0..60):

Example
t = Time.new(2000, 1, 2, 3, 4, 5, 6)
# => 2000-01-02 03:04:05 +000006
t.sec # => 5

Note: the second value may be 60 when there is a leap second.

Related: Time#year, Time#mon, Time#min.

See also #saturday? #strftime #round #subsec also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0