Here you can find the source of getTimestampXDaysFromY(long startTimeInMillis, int daysFromStartDate)
public static Timestamp getTimestampXDaysFromY(long startTimeInMillis, int daysFromStartDate)
//package com.java2s; //License from project: Open Source License import java.sql.Timestamp; import java.util.Calendar; public class Main { public static Timestamp getTimestampXDaysFromY(long startTimeInMillis, int daysFromStartDate) { Calendar cal = getCalendarXDaysFromY(startTimeInMillis, daysFromStartDate); return new Timestamp(cal.getTimeInMillis()); }//www . j a va2 s. com private static Calendar getCalendarXDaysFromY(long startTimeInMillis, int daysFromStartDate) { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(startTimeInMillis); cal.add(Calendar.DAY_OF_YEAR, daysFromStartDate); return cal; } }