Skip to content
Prev 198820 / 398506 Next

question about difference in date objects

Since months have different lengths the difference in months is not
well defined but lets define it as the difference between the first of
the month of two dates. In that case we can use as.yearmon of the zoo
package.  It converts to year/months, dropping days, using an internal
representation of year + 0 for Jan, year + 1/12 for Feb, year + 2/12
for Mar, etc.  so differencing and multiplying by 12 gives the number
of months:
[1] "2009-11-02"
[1] "2009-07-25"
[1] 4


On Mon, Nov 2, 2009 at 6:29 AM, Phil Smith
<philipsmith at alumni.albany.edu> wrote: