Hi,
I want previous month name
for example
Time.now.strftime("%B")
will result the month name "August"
But i need to find the previous month if anybody knows reply me.....
···
--
Posted via http://www.ruby-forum.com/.
Hi,
I want previous month name
for example
Time.now.strftime("%B")
will result the month name "August"
But i need to find the previous month if anybody knows reply me.....
--
Posted via http://www.ruby-forum.com/.
Hi,
thistimelastmonth = Date.today << 1
lastmonth = thistimelastmonth.month
answer = Date::MONTHNAMES[month]
I wouldn't recommend that you use those variable names, but hopefully
you get the idea.
On Wed, Aug 6, 2008 at 9:30 AM, Pragash Mr. <gananapragasam@srishtisoft.com> wrote:
Hi,
I want previous month namefor example
Time.now.strftime("%B")
will result the month name "August"But i need to find the previous month if anybody knows reply me.....
--
Posted via http://www.ruby-forum.com/\.
--
All you can do is try to know who your friends are as you head off to
the war / Pick a star on the dark horizon and follow the light
Shadowfirebird wrote:
Hi,
thistimelastmonth = Date.today << 1
lastmonth = thistimelastmonth.month
answer = Date::MONTHNAMES[month]I wouldn't recommend that you use those variable names, but hopefully
you get the idea.On Wed, Aug 6, 2008 at 9:30 AM, Pragash Mr.
Your example looks cool
I took the liberty to change it to a one liner.
Date::MONTHNAMES[(Date.today << 1).month] # => "July"
--
Posted via http://www.ruby-forum.com/\.