Java Day Start startOfDay(final Date date)

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

Description

start Of Day

License

Open Source License

Declaration

public static Calendar startOfDay(final Date date) 

Method Source Code


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

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

public class Main {
    public static Calendar startOfDay(final Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);// w ww. j a  va 2 s.c  om
        setStartOfDay(calendar);

        return calendar;
    }

    public static void setStartOfDay(final Calendar calendar) {
        calendar.set(Calendar.HOUR, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
    }
}

Related

  1. startOfDay(Date date)
  2. startOfDay(Date date)
  3. startOfDay(Date dateInst)
  4. startOfDay(Date inDate, TimeZone timeZone)
  5. startOfDay(Date value)
  6. startOfDay(final Date date)
  7. startOfDayInMillis(long date)