Java Date Set setHourMinuteSecondToZeroPlus24Hours(Date datetime)

Here you can find the source of setHourMinuteSecondToZeroPlus24Hours(Date datetime)

Description

Sets the hour minute second to zero plus24 hours.

License

Open Source License

Parameter

Parameter Description
datetime the datetime

Return

the date

Declaration

public static Date setHourMinuteSecondToZeroPlus24Hours(Date datetime) 

Method Source Code

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

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

public class Main {
    /**/* ww w  .ja  v a2s  . com*/
     * Sets the hour minute second to zero plus24 hours.
     *
     * @param datetime
     *            the datetime
     * 
     * @return the date
     */
    public static Date setHourMinuteSecondToZeroPlus24Hours(Date datetime) {
        final Calendar calendar = Calendar.getInstance();
        calendar.setTime(datetime);
        calendar.set(Calendar.HOUR, 23);
        calendar.set(Calendar.MINUTE, 59);
        calendar.set(Calendar.SECOND, 59);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.set(Calendar.AM_PM, 0);
        return calendar.getTime();
    }
}

Related

  1. setDateToDayStart(final Date date)
  2. setDateToStartOfDay(Date date)
  3. setDayStart(final Date date)
  4. setField(Date date, int field, int value)
  5. setHour(java.util.Date date, Integer hour)
  6. setHours(Date d, int hours)
  7. setHours(Date date, int amount)
  8. setMilliSecondsToDate(Date date, Integer milliSeconds)
  9. setMinDate(Date d)