On Tue, 2006-01-17 at 04:45 +0900, Mason Kessinger wrote:
> What I want to do is simple.
> 
> I'd like code that prints out the name of this month (January) the next 
> month (February) and the one after that (March)
> 
> I've been able to print this month:
> 
> <% t = Time.now %>
> <%= t.strftime(" This Month is: %B") %>
> 
> But I can't figure out how to get the next months to print out!

Well you'd add the month, expressed in seconds, to the current time.
That would be:

irb(main):001:0> puts (Time.now + 60 * 60 * 24 * 30).strftime("Next
month is %B")
Next month is February
=> nil

(Assuming a month is thirty days)

You are probably using Rails (I assume), so you can do this instead:

irb(main):002:0> require_gem 'activerecord'
=> true
irb(main):003:0> puts (Time.now + 1.month).strftime("Next month is %B")
Next month is February
=> nil

Again, that assumes a month is thirty days. A more reliable way would be
to find the next month, work out its length in seconds (precisely), and
then add it to Time.now.

Jon

-- 
Jonathan Leighton
http://turnipspatch.com/ | http://jonathanleighton.com/ | http://digital-proof.org/