Java Date Set resetHourMinSecMill(Date date)

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

Description

reset Hour Min Sec Mill

License

Open Source License

Declaration

public static java.util.Calendar resetHourMinSecMill(Date date) 

Method Source Code


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

import java.util.Date;

public class Main {
    public static java.util.Calendar resetHourMinSecMill(Date date) {
        java.util.Calendar calendar = java.util.Calendar.getInstance();
        if (date != null) {
            calendar.setTime(date);/*from w  w w.jav  a2 s .  com*/
        }
        calendar.set(java.util.Calendar.MILLISECOND, 0);
        calendar.set(java.util.Calendar.SECOND, 0);
        calendar.set(java.util.Calendar.MINUTE, 0);
        calendar.set(java.util.Calendar.HOUR_OF_DAY, 0);
        return calendar;
    }
}

Related

  1. resetDay(Date date)
  2. resetTime(Date date)
  3. resetTime(Date dt)
  4. setDate(Date date, int year, int month, int day)
  5. setDate(Date dateToSet, int hours, int minutes, int seconds, int milisec, TimeZone zone, Locale locale)