Java Milliseconds resetHourMinSecMill(final Date date)

Here you can find the source of resetHourMinSecMill(final Date date)

Description

Reset hours, minutes, seconds and milliseconds

License

Apache License

Parameter

Parameter Description
date the date

Return

the date with reseted field

Declaration

public static Date resetHourMinSecMill(final Date date) 

Method Source Code

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

import java.util.*;

public class Main {
    /**//from www .j  av a  2s  .c  om
     * Reset hours, minutes, seconds and milliseconds
     *
     * @param date the date
     * @return the date with reseted field
     */
    public static Date resetHourMinSecMill(final Date date) {
        final int hourOfDay = 17;
        final Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.set(Calendar.HOUR_OF_DAY, hourOfDay);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
        return cal.getTime();
    }
}

Related

  1. parseDate(long milliseconds)
  2. printTimeFromMilliseconds(long milliseconds)
  3. putMillisToByteArray(byte[] buff, long value, int offset)
  4. readableTransferRate(long size, long millis)
  5. relTimestrMillis(long time)
  6. resetMilliseconds(long msec)
  7. reverseTimeMillis(long currentTimeMillis)
  8. rollMockClockMillis(long millis)
  9. roundMicrosToMillis(String micros)