# Time.advance( :minutes=\> x ) question

**URL:** <https://www.ruby-forum.com/t/time-advance-minutes-x-question/123083>\
**Category:** Rails\
**Created:** [December 13, 2007, 10:27pm UTC](https://www.ruby-forum.com/t/time-advance-minutes-x-question/123083 "2007-12-13T22:27:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [December 13, 2007, 10:27pm UTC](https://www.ruby-forum.com/t/time-advance-minutes-x-question/123083/1 "2007-12-13T22:27:54Z")

</div>

Hello all-I’m a new Ruby developer(but longtime java developer), and  
I’m having trouble getting Time to work for me.

With a ‘base’ date as Monday of this week:  
Time.now.beginning\_of\_week.asctime  
=\> “Mon Dec 10 00:00:00 2007”

I can advance days without problems

> > Time.now.beginning\_of\_week.advance({ :days=\> 15 } )  
> > =\> Tue Dec 25 00:00:00 -0600 2007

but if I try to advance minutes, my code fails silently:

> > Time.now.beginning\_of\_week.advance({ :minutes=\> 15 } ).asctime  
> > Time.now.beginning\_of\_week.advance({ :minutes=\> 15 } ).asctime  
> > =\> “Mon Dec 10 00:00:00 2007”

Any ideas on what I’m doing wrong? I’m on Rails 1.2.6

---

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [December 14, 2007, 2:01am UTC](https://www.ruby-forum.com/t/time-advance-minutes-x-question/123083/2 "2007-12-14T02:01:27Z")

</div>

Good Question it seems to work for me in Rails 2.0.1:

> > Time.now.beginning\_of\_week.advance({ :minutes =\> 15 }).asctime  
> > =\> “Mon Dec 10 00:15:00 2007”
