On Mon, 02 Nov 2009 06:29:54 -0500 Phil Smith 
<philipsm...@alumni.albany.edu> wrote:
> I want to take the difference in two dates:
> 
> dt2 - dt1.
> 
> But, I want the answer in months between those 2 dates.

What do you mean by 'months'? The number of days in a month vary, so the 
number of months between two dates is not defined. But if you're willing 
to think of a month as 30 days, you just have to divide by 30:

d=dt2-dt1
d/30

or

as.numeric(d)/30

if you want to avoid the (wrong) textual description.

-- 
Karl Ove Hufthammer

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to