Java Date Clear clearHourMinute(Date date)

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

Description

clear Hour Minute

License

Apache License

Declaration

public static Date clearHourMinute(Date date) 

Method Source Code

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

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

public class Main {

    public static Date clearHourMinute(Date date) {
        if (date == null)
            return null;
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);/*from  ww w . j  a va 2 s  .co m*/
        calendar.set(Calendar.HOUR, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        return calendar.getTime();
    }
}

Related

  1. clearDate(Date date)
  2. clearDate(Date dateTime)
  3. clearDate(final Date date)
  4. clearDisplayFileCreationDateCache(final String absolutePath)
  5. clearTime(Date date)
  6. clearTime(Date date)
  7. clearTime(GregorianCalendar date)
  8. clearTimeComponent(Date date)