Java Calendar Time stripTime(final Calendar cal)

Here you can find the source of stripTime(final Calendar cal)

Description

strip Time

License

Open Source License

Declaration

public static void stripTime(final Calendar cal) 

Method Source Code


//package com.java2s;
/*//  ww  w .  j  a v  a2s  .c om
 * Copyright 2012 Oracle and/or its affiliates.
 * All rights reserved.  You may not modify, use,
 * reproduce, or distribute this software except in
 * compliance with  the terms of the License at:
 * http://developers.sun.com/license/berkeley_license.html
 */

import java.util.Calendar;

public class Main {
    public static void stripTime(final Calendar cal) {
        // remove all the time information
        cal.clear(Calendar.AM_PM);
        cal.clear(Calendar.HOUR_OF_DAY);
        cal.clear(Calendar.HOUR);
        cal.clear(Calendar.MINUTE);
        cal.clear(Calendar.SECOND);
        cal.clear(Calendar.MILLISECOND);
    }
}

Related

  1. setTime(final Calendar calendat, final String[] test)
  2. setTimeFrom(Calendar c)
  3. setTimeTo0(final Calendar calendar)
  4. setTimeToMidnight(GregorianCalendar c)
  5. setTimeToMinOrMax(Calendar cal, boolean max)
  6. stripTimeComponent(Calendar cal)
  7. time2InicioDelDia(Calendar fecha)
  8. timestamp17ToCalendar(String timestamp17String)
  9. timestamp2Calendar(long timestamp)