Skip to content
Prev 78891 / 398502 Next

adding 1 month to a date

On Wed, 12 Oct 2005, Jim Porzak wrote:

            
It depends how you intend "1 month after 2004-01-31".  Is the the same
number of days before the beginning of the next month or after the end of
the stated month?

   seq(as.Date("2004-02-01"), by = "month", length = 14)-1

   [1] "2004-01-31" "2004-02-29" "2004-03-31" "2004-04-30" "2004-05-31"

Dave