The arguments to Time.local are (in order) year, month, date, hour, minutes, seconds. You can also call local with these arguments: : local « Time « Ruby






The arguments to Time.local are (in order) year, month, date, hour, minutes, seconds. You can also call local with these arguments:


my_time = Time.local( 20, 15, 1, 30, "jan", 2007, 2, 30, false, "MST")
# => Tue Jan 30 01:15:20 -0700 2007

# arguments are seconds, minutes, hour, day, month, year, day of the week, day of the year, is-it-daylight-savings-time?, and timezone.

 








Related examples in the same category

1.The Time class allows you to create Time objects based on arbitrary dates:
2.To set a given time, use the local method (mktime is a synonym):
3.ArgumentError: time out of range
4.Create Time.local