Java tutorial
import java.util.GregorianCalendar; import java.util.Calendar; public class Main { public static void main(String[] args) { Calendar today = new GregorianCalendar(); Calendar purchased = new GregorianCalendar(); purchased.add(Calendar.DAY_OF_MONTH, 1); Calendar lastActDate = new GregorianCalendar(); lastActDate.setTimeInMillis(today.getTimeInMillis() - purchased.getTimeInMillis()); } }