Java Hour Calculate getDelayEndTime(int hour, String timezone)

Here you can find the source of getDelayEndTime(int hour, String timezone)

Description

get Delay End Time

License

Apache License

Declaration

public static String getDelayEndTime(int hour, String timezone) 

Method Source Code

//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());
    }
}

Related

  1. addHours(int date, int hours)
  2. addNHours(Date date, int hours)
  3. diffHour(String day1, String day2)
  4. getBothTime(String startTime, int hours)
  5. getCurrHourDate()
  6. getDelayTime(int hour, String date)
  7. getDiffDateTime(int diff, int hours)
  8. getDiffHour(String startTime, String endTime)
  9. getDoubleValue(String hours)