title: Add one year to a posix time
body: <p>I have a date like <code>"2016-01-01"</code> (YYYY-MM-DD) and I'm using <code>as.numeric(as.POSIXct(...))</code> to use it as an Integer.</p>
  
  <p>My question is, is there a way to add to this date a year, a month or a day ?
  I mean, if I add one year to 2016 it wont be the same as adding a year to 2015 (bissextile stuff).</p>
  
  <p>Same as adding 32 days to January 01 wont be the same as adding 32 days to February 01 (because of number of days that may change)</p>
  
  <p>I managed to have something that works for years and months but I'd like to implement <strong>days</strong> as well
  </p>
  
  <pre><code>how_long_is_simul &lt;- function(lst){
      # Format DATE_START
      greg_date = intDate_to_gregorianDate(DATE_START)
      reg = "^([0-9]{4})\\-([0-9]{2})\\-([0-9]{2})$" # black-magic
      splited_date = str_match(greg_date, reg)
  
      # Manage months limit
      lst$years = lst$years + floor(lst$months/12)
      lst$months = lst$months%%12
  
      # Build new date
      my_vector = c(lst$years, lst$months, 0)
      end_date = paste(as.numeric(splited_date[2:4]) + my_vector, collapse = "-")
      return(round((gregorianDate_to_intDate(end_date)-DATE_START)/86400))
  }
  
  # AND the vars used by the function
  DATE_START &lt;- 1451606400 # 2016-01-01 GMT
  lst   = list( # no days, because of bissextile years
      years  = 1,
      months = 0
  )
  </code></pre>
  
  <p>Basically what I'm doing is from a <code>DATE_START</code> integer transform it into gregorian then add the months / years from <code>lst</code> then rebuild a clean string and reconvert it to integer.</p>
  
  <p>N.B. Conversion int &lt;---> gregorian are done with POSIXct</p>
  
  <p>I'm not sure if I explained it well, but thank you anyway :)</p>