Java Date to Day getDayTime(Date date, int hour, int minute, int second)

Here you can find the source of getDayTime(Date date, int hour, int minute, int second)

Description

get Day Time

License

Apache License

Declaration

public static Date getDayTime(Date date, int hour, int minute, int second) 

Method Source Code

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

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

public class Main {
    public static Date getDayTime(Date date, int hour, int minute, int second) {
        GregorianCalendar gc = new GregorianCalendar();
        gc.setTime(date);/* w  ww  . jav  a 2 s.c  o m*/
        gc.set(Calendar.HOUR_OF_DAY, hour);
        gc.set(Calendar.MINUTE, minute);
        gc.set(Calendar.SECOND, second);
        return gc.getTime();
    }
}

Related

  1. getDaysMin(Date d)
  2. getDaysPassedSince(Date dateLastModified)
  3. getDayStart(Date date)
  4. getDayStart(final Date date)
  5. getDaysToLong(Date date1, Date date2)