Here you can find the source of getDelayEndTime(int hour, String timezone)
public static String getDelayEndTime(int hour, String timezone)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static String getDelayEndTime(int hour, String timezone) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(new Date().getTime()); calendar.add(10, hour);//from w w w . ja v a 2s. co m SimpleDateFormat dateFormatGmt = new SimpleDateFormat("yyyy-MM-dd HH:59:59"); dateFormatGmt.setTimeZone(TimeZone.getTimeZone(timezone)); return dateFormatGmt.format(calendar.getTime()); } }