Java Date Before getBeforeHourByCurrentTime(Date now, int mount)

Here you can find the source of getBeforeHourByCurrentTime(Date now, int mount)

Description

get Before Hour By Current Time

License

Open Source License

Declaration

public static Date getBeforeHourByCurrentTime(Date now, int mount) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static Date getBeforeHourByCurrentTime(Date now, int mount) {
        Calendar c = Calendar.getInstance();
        c.setTime(now);//from   w w w . j  a va 2s .  c  o m
        c.set(Calendar.HOUR_OF_DAY, c.get(Calendar.HOUR_OF_DAY) + mount);
        return c.getTime();
    }
}

Related

  1. beforeTime(Date time1, Date time2)
  2. daysBefore(Date date1)
  3. getBefore(Date date)
  4. getBeforeDate(final int unit, final int period)
  5. getBeforeDate(String range)
  6. getBeforeOrAfterDateByDayNumber(int dayNumber)
  7. getDateBefore(Date d, int day)
  8. getDateBefore(Date d, int day)
  9. getDateBefore(Date date, int days)