# Time.now - time.at

**URL:** <https://www.ruby-forum.com/t/time-now-time-at/112208>\
**Category:** Rails\
**Created:** [August 16, 2007, 12:29pm UTC](https://www.ruby-forum.com/t/time-now-time-at/112208 "2007-08-16T12:29:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [August 16, 2007, 12:29pm UTC](https://www.ruby-forum.com/t/time-now-time-at/112208/1 "2007-08-16T12:29:22Z")

</div>

Hello frnds

I want to find out the difference between Time.now and Time.at where  
Time.at is the unix time eg:- Time.at(1186113109) and them compare that  
if the difference is greater than 1 day then certain task should be  
done.

Can neone tell me how to do it

Thanks

Dhaval P.

---

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [August 16, 2007, 12:36pm UTC](https://www.ruby-forum.com/t/time-now-time-at/112208/2 "2007-08-16T12:36:23Z")

</div>

Dhaval P. wrote:

> Hello frnds
> 
> I want to find out the difference between Time.now and Time.at where  
> Time.at is the unix time eg:- Time.at(1186113109) and them compare that  
> if the difference is greater than 1 day then certain task should be  
> done.
> 
> Can neone tell me how to do it
> 
> Thanks
> 
> Dhaval P.

if (Time.now - Time.at(1186113109)) \> 1.day

# do your stuff

end

Greetings  
Skade

---

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [August 16, 2007, 12:47pm UTC](https://www.ruby-forum.com/t/time-now-time-at/112208/3 "2007-08-16T12:47:16Z")

</div>

Thanks a lot Florian for your reply.
