Java Date Calculate adjust(Date date, int h, int m, int s)

Here you can find the source of adjust(Date date, int h, int m, int s)

Description

adjust

License

Open Source License

Declaration

public static final Date adjust(Date date, int h, int m, int s) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {

    public static final Date adjust(Date date, int h, int m, int s) {
        Calendar calender = Calendar.getInstance();
        calender.setTime(date);//from w  w  w  .ja  va  2 s  .com
        calender.set(Calendar.HOUR_OF_DAY, h);
        calender.set(Calendar.MINUTE, m);
        calender.set(Calendar.SECOND, s);
        return calender.getTime();
    }
}

Related

  1. after(Date dt, Date dt2)
  2. before(Date dt, Date dt2)
  3. before(final Date date, final long compareTime)
  4. calculaDataTermino(Date dataInicio, int prazo)