Here you can find the source of add24HtoDate(Date date)
public static Date add24HtoDate(Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Date add24HtoDate(Date date) { Calendar cal = new GregorianCalendar(); cal.setTime(date);// w w w. jav a 2 s.c om cal.setTimeInMillis(date.getTime());// sumamos 24h a la fecha del login cal.add(Calendar.DATE, 1); return new Date(cal.getTimeInMillis()); } public static String getTime() { SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); return sdf.format(new Date()); } }