# How to find Date and Time difference in controller?

**URL:** <https://www.ruby-forum.com/t/how-to-find-date-and-time-difference-in-controller/138718>\
**Category:** Rails\
**Created:** [May 27, 2008, 6:58am UTC](https://www.ruby-forum.com/t/how-to-find-date-and-time-difference-in-controller/138718 "2008-05-27T06:58:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ratnavel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/6f9a4e/32.png) [@ratnavel](https://www.ruby-forum.com/u/ratnavel)\
**Post date:** [May 27, 2008, 6:58am UTC](https://www.ruby-forum.com/t/how-to-find-date-and-time-difference-in-controller/138718/1 "2008-05-27T06:58:12Z")

</div>

Hi,

I need a method similar to “distance\_of\_time\_in\_words\_to\_now” to be used  
in the controller.

“distance\_of\_time\_in\_words\_to\_now” methods work only in view.

Thanks,  
Ratnavel.
