Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Time.mktime

mktime(*args)

Alias of .local

Like Time.utc, except that the returned Time object has the local timezone, not the UTC timezone:

Example
# With seven arguments.
Time.local(0, 1, 2, 3, 4, 5, 6)
# => 0000-01-02 03:04:05.000006 -0600
# With exactly ten arguments.
Time.local(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
# => 0005-04-03 02:01:00 -0600
See also .local .new .json_create .now also in 4.1 · 4.0 · 3.4 · 3.3 · 3.0