Skip to content
class method

Time.local

(::Integer year, ?::Integer | ::String month, ?::Integer day, ?::Integer hour, ?::Integer min, ?::Numeric sec, ?::Numeric usec_with_frac) -> ::Time
Time.local(year, month = 1, mday = 1, hour = 0, min = 0, sec = 0, usec = 0) → new_time
Time.local(sec, min, hour, mday, month, year, dummy, dummy, dummy, dummy) → new_time

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 .json_create .mktime .iso8601 .new also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0