Displaying 3 results from an estimated 3 matches for "months_since".
2007 Dec 12
6
Add a month to a Date object
Howdy all,
This may be the dumbest question in the world, but how can you "add
one month" to a Date object? I can''t just add 30 days, because months
have varying lengths.
Any help would be much appreciated...
Thanks!
-Neal
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2009 Feb 04
4
Rails 2.2.2 to_date and to_datetime methods
In the console I see this behaviour:
>> "19270412000000".to_date.methods
=> ["ns?", "mon", "ago", "end_of_month", "months_since",
"default_inspect", "minus_without_duration", ...
>> "19270412000000".to_date.class
=> Date
>> "19270412000000".class
=> String
>> String.to_date.methods
NoMethodError: undefined method `to_date'' for String:Class...
2006 Oct 22
12
How to subtract months from time?
Hi there,
Im reading a date out of a database and I need to subtract exactly 1
month from that date? It needs to be bullet proof so that if the date
says 31 and the previous month only has 28 days it wont just subtract 1
from the month and make an illegal date.
Thanks
Petr
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this