Method: FFaker::Time#between
- Defined in:
- lib/ffaker/time.rb
#between(from, to) ⇒ Object
44 45 46 47 48 |
# File 'lib/ffaker/time.rb', line 44 def between(from, to) from_value = convert_to_time(from) to_value = convert_to_time(to) ::Time.at(from_value + (rand * (to_value.to_f - from_value.to_f))) end |