Skip to content
Prev 78865 / 398502 Next

adding 1 month to a date

Simple addition and subtraction works as well:
  as.Date("1995/12/01",format="%Y/%m/%d") + 30
If you have datetime values you can use
  strptime("1995-12-01 08:00:00",format="%Y-%m-%d %H:%M:%S") + 30*24*3600
where 30*24*3600 = 30 days expressed in seconds.