To set a given time, use the local method (mktime is a synonym): : local « Time « Ruby






To set a given time, use the local method (mktime is a synonym):


local_time = Time.local( 2007, "jan", 30, 1, 15, 20 )
puts local_time

 








Related examples in the same category

1.The Time class allows you to create Time objects based on arbitrary dates:
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