Skip to content
Prev 360740 / 398502 Next

month and output

Thank you very much David.

So there is no general formal that works year all round.

The first one work only Jan to Nov
today <- Sys.Date()
nextmo<- paste0( month.abb[ as.numeric(format(today, format="%m"))+1] ,
                 format(today,"%Y") )
[1] "Jun2016"

The second one works only  for the last month of the year.
today <- as.Date("2008-12-01")
 nextmo<- paste0(m <- month.abb[(as.numeric(format(today,
format="%m"))+1) %/% 12] ,
                  as.numeric( format(today,"%Y") ) + (m == "Jan") )
 nextmo


Many thanks
On Fri, May 6, 2016 at 6:40 PM, David Winsemius <dwinsemius at comcast.net> wrote: