Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getFragmentDate(int offSet) { Date fragmentdate = new Date(System.currentTimeMillis() + (offSet * 86400000)); SimpleDateFormat mformat = new SimpleDateFormat("yyyy-MM-dd"); return mformat.format(fragmentdate); } }