Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String getDeadTime(int unit, int amount) { Calendar nowTime = Calendar.getInstance(); nowTime.add(unit, amount); nowTime.add(Calendar.HOUR_OF_DAY, 8); return new SimpleDateFormat("yyyyMMddHHmmssSSS").format(nowTime.getTime()); } }