Java Hour Add addHour(Date baseDate, int hour, TimeZone timezone)

Here you can find the source of addHour(Date baseDate, int hour, TimeZone timezone)

Description

add Hour

License

Apache License

Declaration

public static Date addHour(Date baseDate, int hour, TimeZone timezone) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;

import java.util.TimeZone;

public class Main {
    public static Date addHour(Date baseDate, int hour, TimeZone timezone) {
        Calendar cal = Calendar.getInstance();
        cal.setTimeZone(timezone);/*from ww  w  . j ava 2  s.co m*/
        cal.setTime(baseDate);
        cal.add(Calendar.HOUR_OF_DAY, hour);
        return cal.getTime();
    }
}

Related

  1. addHH(Date date, int i)
  2. addHour(Date date, boolean up)
  3. addHour(java.util.Date d, int h)
  4. addHours(Date date, int hours)
  5. addHours(long date, int hours)