# Time

**URL:** <https://www.ruby-forum.com/t/time/143705>\
**Category:** Rails\
**Created:** [July 22, 2008, 1:09am UTC](https://www.ruby-forum.com/t/time/143705 "2008-07-22T01:09:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [July 22, 2008, 1:09am UTC](https://www.ruby-forum.com/t/time/143705/1 "2008-07-22T01:09:25Z")

</div>

Activerecord automatically stores the time for created\_at and updated\_at  
as UTC, and this is what it looks like: 2008-07-21 18:55:29 UTC

How can I get the Time.now to look like that?

I’m trying to find the difference of the Time.now and created\_at so I  
can get a number of days, hours, or seconds depending on the magnitude  
of the difference, since my object was created.

Thanks!

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [July 22, 2008, 1:29am UTC](https://www.ruby-forum.com/t/time/143705/2 "2008-07-22T01:29:14Z")

</div>

Hi -

If I am understanding correctly you can use the Time#strftime  
directives.

[http://www.ruby-doc.org/core/classes/Time.html](http://www.ruby-doc.org/core/classes/Time.html)
