Java Date to Minute getMinDateOfDay(Date date)

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

Description

get Min Date Of Day

License

Apache License

Declaration

public static Date getMinDateOfDay(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 getMinDateOfDay(Date date) {
        if (date == null) {
            return null;
        } else {/*from   w  w  w .j av a2 s .c  o  m*/
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(date);
            calendar.set(11, calendar.getActualMinimum(11));
            calendar.set(12, calendar.getActualMinimum(12));
            calendar.set(13, calendar.getActualMinimum(13));
            calendar.set(14, calendar.getActualMinimum(14));
            return calendar.getTime();
        }
    }
}

Related

  1. getMinHour(Date date)
  2. getMins(Date date)
  3. getMinTime(Date date)
  4. getMinus1Day(Date date)