Java Calendar Night setMidnight(Calendar cal)

Here you can find the source of setMidnight(Calendar cal)

Description

set Midnight

License

Open Source License

Declaration

public static void setMidnight(Calendar cal) 

Method Source Code


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

import java.util.Calendar;

public class Main {
    public static void setMidnight(Calendar cal) {
        cal.set(Calendar.MILLISECOND, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.HOUR_OF_DAY, 0);
    }/*from  ww w .j a v  a  2  s .  c  om*/
}

Related

  1. getMidnightCalendar()
  2. getMidnightCalendarInstance()
  3. midnightOf(Calendar cal)
  4. setMidnight(Calendar date)
  5. setMidnight(final Calendar cal)
  6. toMidnightCalendar(Date date)