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 Date startOfDay(final Date date) 

Method Source Code


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

import static java.util.Calendar.DAY_OF_MONTH;

import static java.util.Calendar.MONTH;
import static java.util.Calendar.YEAR;

import java.util.Date;
import java.util.GregorianCalendar;

public class Main {
    public static Date startOfDay(final Date date) {
        final GregorianCalendar dateCalendar = new GregorianCalendar();
        dateCalendar.setTime(date);/*from   w  w w  . j a v a  2  s.  c  o  m*/

        return new GregorianCalendar(dateCalendar.get(YEAR), dateCalendar.get(MONTH),
                dateCalendar.get(DAY_OF_MONTH)).getTime();
    }
}

Related

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