The Time class allows you to create Time objects based on arbitrary dates: : local « Time « Ruby






The Time class allows you to create Time objects based on arbitrary dates:


# Time.local(year, month, day, hour, min, sec, msec)

puts Time.local(2008, 8, 31, 2, 3, 4, 5)

 








Related examples in the same category

1.To set a given time, use the local method (mktime is a synonym):
2.The arguments to Time.local are (in order) year, month, date, hour, minutes, seconds. You can also call local with these arguments:
3.ArgumentError: time out of range
4.Create Time.local