Java Calendar Time clearTimeFields(Set c)

Here you can find the source of clearTimeFields(Set c)

Description

Clears the date fields on the specified calendar collection.

License

Apache License

Parameter

Parameter Description
c a parameter

Declaration

public static void clearTimeFields(Set<Calendar> c) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

import java.util.Set;

public class Main {
    /**/*from w  w w . j  a  v a 2  s. c om*/
     * Clears the date fields on the specified calendar collection.
     *
     * @param c
     */
    public static void clearTimeFields(Set<Calendar> c) {
        for (Calendar cal : c) {
            clearTimeFields(cal);
        }
    }

    /**
     * Clears the time fields on the specified calendar.
     *
     * @param c
     */
    public static void clearTimeFields(Calendar c) {
        if (c != null) {
            c.clear(Calendar.AM);
            c.clear(Calendar.DST_OFFSET);
            c.clear(Calendar.HOUR);
            c.clear(Calendar.HOUR_OF_DAY);
            c.clear(Calendar.MILLISECOND);
            c.clear(Calendar.SECOND);
            c.clear(Calendar.MINUTE);
            c.clear(Calendar.ZONE_OFFSET);
        }
    }
}

Related

  1. clearTime(Calendar cal)
  2. clearTime(Calendar cal)
  3. clearTime(Calendar calendar)
  4. clearTime(final Calendar c)
  5. clearTimeFields(final Calendar calendar)
  6. clearTimeFromCalendar(Calendar calendar)
  7. compareTimeOnly(Calendar cal1, Calendar cal2)
  8. convertCalendar(final Calendar calendar, final TimeZone timeZone)
  9. convertTimeToLocalTimezone(Long pTime, Calendar pTargetCal)