code: private String getStrDate(Calendar c)
     {
        int m = c.get(Calendar.MONTH) + 1;
        int d = c.get(Calendar.DATE);
        return "" + c.get(Calendar.YEAR) + (m < 10 ? "0" + m : m) + (d < 10 ? "0" + d : d);
     }
docs: Returns date as String in format YYYYMMDD.