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
time.c
View on GitHub ↗
static VALUE
time_s_mktime(int argc, VALUE *argv, VALUE klass)
{
struct vtm vtm;
time_arg(argc, argv, &vtm);
return time_localtime(time_new_timew(klass, timelocalw(&vtm)));
}
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