Java Calendar Day getCleanDay(Calendar c)

Here you can find the source of getCleanDay(Calendar c)

Description

get Clean Day

License

Open Source License

Declaration

private static Date getCleanDay(Calendar c) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static Date getCleanDay(Date day) {
        return getCleanDay(getCalendar(day));
    }/*from  w  w w .  j a va 2  s .  com*/

    private static Date getCleanDay(Calendar c) {
        c.set(11, 0);
        c.clear(12);
        c.clear(13);
        c.clear(14);
        return c.getTime();
    }

    public static Calendar getCalendar(Date day) {
        Calendar c = Calendar.getInstance();
        if (day != null)
            c.setTime(day);
        return c;
    }
}

Related

  1. endOfDay(Calendar calendar)
  2. getAge(Calendar dateOfBirth, Calendar onThisDay)
  3. getBeginDay(Calendar cal)
  4. getCanonicalDay(Calendar cal)
  5. getCanonicalDayFrom(Calendar day, int daysFrom)
  6. getCurDay(Calendar calendar)
  7. getDay(Calendar cal)
  8. getDay(Calendar calendar)
  9. getDay(Calendar calendar)