Here you can find the source of sumaMesFull(String sF, int n)
public static final String sumaMesFull(String sF, int n)
//package com.java2s; //License from project: Apache License public class Main { public static final String sumaMesFull(String sF, int n) { int n0 = Math.abs(n); String sF0 = sF;/*ww w.jav a 2 s .co m*/ for (int i = 0; i < n0; i++) { sF0 = incMesFull(sF0); } return sF0; } public static final String incMesFull(String sFec0) { int nDia = Integer.parseInt(sFec0.substring(0, 2)); int nMes = Integer.parseInt(sFec0.substring(3, 5)); int nAno = Integer.parseInt(sFec0.substring(6, 10)); // if (nDia == 31) { nDia = 30; } nMes += 1; if (nMes == 13) { nMes = 1; nAno += 1; } return makeDateFormatFull(nDia, nMes, nAno); } public static final String makeDateFormatFull(int nDay, int nMonth, int nYear) { String sRes = padNmbFull(nDay, 2, "0") + "/" + padNmbFull(nMonth, 2, "0") + "/" + padNmbFull(nYear, 4, "0"); return sRes; } public static final String padNmbFull(int nStr, int nLen, String sChr) { String sRes = String.valueOf(nStr); if (String.valueOf(nStr).length() < nLen) { for (int rm = 0; rm < (nLen - String.valueOf(nStr).length()); rm++) { sRes = sChr + sRes; } } return sRes; } }