Java Calendar Time clearTime(Calendar cal)

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

Description

clear Time

License

Open Source License

Declaration

public static void clearTime(Calendar cal) 

Method Source Code

//package com.java2s;
// The MIT License (MIT)

import java.util.Calendar;

import java.util.GregorianCalendar;

public class Main {
    public static java.util.Date clearTime(java.util.Date d) {
        Calendar cal = new GregorianCalendar();
        cal.setTime(d);//from   w  w w. j  a va  2  s. co m

        clearTime(cal);
        return cal.getTime();
    }

    public static void clearTime(Calendar cal) {
        cal.set(Calendar.HOUR_OF_DAY, 0);
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        cal.set(Calendar.MILLISECOND, 0);
    }
}

Related

  1. calendarToGPSTime(Calendar calendar)
  2. ceilTime(Calendar calendar)
  3. clearCalendarTime(Calendar cal)
  4. clearCalendarTimeParts(Calendar cal)
  5. clearTime(Calendar c)
  6. clearTime(Calendar cal)
  7. clearTime(Calendar calendar)
  8. clearTime(final Calendar c)
  9. clearTimeFields(final Calendar calendar)