Reputation: 266988
How can I create a random time within a time interval? I want to create a random time between 9am and 11:30am.
Upvotes: 2
Views: 331
Reputation: 5363
use rand()
rand()
rand(Time.parse('9 am')..Time.parse('11:30 am'))
Upvotes: 9