# Human-friendly time period descriptions

**URL:** <https://www.ruby-forum.com/t/human-friendly-time-period-descriptions/91159>\
**Category:** Rails\
**Created:** [April 5, 2007, 7:46am UTC](https://www.ruby-forum.com/t/human-friendly-time-period-descriptions/91159 "2007-04-05T07:46:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [April 5, 2007, 7:46am UTC](https://www.ruby-forum.com/t/human-friendly-time-period-descriptions/91159/1 "2007-04-05T07:46:04Z")

</div>

Thought I’d post this as it might be useful to someone else as well.

I was looking for a way to convert the difference in duration between  
two  
times, in seconds, to a friendly, human-readable form such as “2 weeks,  
3  
days, 1 hour and 11 minutes” similar to the way  
distance\_of\_time\_in\_words()  
does for past times in DateHelper.

I couldn’t find one already made so I wrote my own:

[http://www.postal-code.com/binarycode/2007/04/04/english-friendly-timespan/](http://www.postal-code.com/binarycode/2007/04/04/english-friendly-timespan/)

I think this sort of thing might be useful to others if included in  
DateHelper. Thoughts?

Cheers  
Chris

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [April 5, 2007, 10:25pm UTC](https://www.ruby-forum.com/t/human-friendly-time-period-descriptions/91159/2 "2007-04-05T22:25:38Z")

</div>

Thought I’d post this as it might be useful to someone else as well.

I was looking for a way to convert the difference in duration between  
two  
times, in seconds, to a friendly, human-readable form such as “2 weeks,  
3  
days, 1 hour and 11 minutes” similar to the way  
distance\_of\_time\_in\_words()  
does for past times in DateHelper.

I couldn’t find one already made so I wrote my own:

```
 http://www.postal-code.com/binarycode/2007/04/04/english-friendly-timespan/

```

I think this sort of thing might be useful to others if included in  
DateHelper. Thoughts?

Cheers  
Chris
