Here you can find the source of get8BitTime(Date date, int deltaDay)
public static String get8BitTime(Date date, int deltaDay)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String get8BitTime(Date date, int deltaDay) { SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); Calendar cal = Calendar.getInstance(); cal.setTime(date);//from w w w. j a va2 s . c o m cal.add(Calendar.DAY_OF_YEAR, deltaDay); return format.format(cal.getTime()); } }