distance_of_time_in_words(from_time, to_time = 0, include_seconds = false) public

Reports the approximate distance in time between two Time objects or integers. For example, if the distance is 47 minutes, it’ll return "about 1 hour". See the source for the complete wording list.

Integers are interpreted as seconds. So, distance_of_time_in_words(50) returns "less than a minute".

Set include_seconds to true if you want more detailed approximations if distance < 1 minute

Show source
Register or log in to add new notes.