Package java.util

Examples of java.util.GregorianCalendar.clear()


         calNow.clear(Calendar.HOUR_OF_DAY);
         calNow.clear(Calendar.MINUTE);
         calNow.clear(Calendar.SECOND);
         calNow.clear(Calendar.MILLISECOND);

         calLast.clear(Calendar.AM_PM);
         calLast.clear(Calendar.HOUR);
         calLast.clear(Calendar.HOUR_OF_DAY);
         calLast.clear(Calendar.MINUTE);
         calLast.clear(Calendar.SECOND);
         calLast.clear(Calendar.MILLISECOND);
View Full Code Here


         calNow.clear(Calendar.MINUTE);
         calNow.clear(Calendar.SECOND);
         calNow.clear(Calendar.MILLISECOND);

         calLast.clear(Calendar.AM_PM);
         calLast.clear(Calendar.HOUR);
         calLast.clear(Calendar.HOUR_OF_DAY);
         calLast.clear(Calendar.MINUTE);
         calLast.clear(Calendar.SECOND);
         calLast.clear(Calendar.MILLISECOND);
View Full Code Here

         calNow.clear(Calendar.SECOND);
         calNow.clear(Calendar.MILLISECOND);

         calLast.clear(Calendar.AM_PM);
         calLast.clear(Calendar.HOUR);
         calLast.clear(Calendar.HOUR_OF_DAY);
         calLast.clear(Calendar.MINUTE);
         calLast.clear(Calendar.SECOND);
         calLast.clear(Calendar.MILLISECOND);

         long millisPerDay = 86400000; // 24 * 60 * 60 * 1000
 
View Full Code Here

         calNow.clear(Calendar.MILLISECOND);

         calLast.clear(Calendar.AM_PM);
         calLast.clear(Calendar.HOUR);
         calLast.clear(Calendar.HOUR_OF_DAY);
         calLast.clear(Calendar.MINUTE);
         calLast.clear(Calendar.SECOND);
         calLast.clear(Calendar.MILLISECOND);

         long millisPerDay = 86400000; // 24 * 60 * 60 * 1000
         long millisDelta = calNow.getTime().getTime() - calLast.getTime().getTime();
View Full Code Here

         calLast.clear(Calendar.AM_PM);
         calLast.clear(Calendar.HOUR);
         calLast.clear(Calendar.HOUR_OF_DAY);
         calLast.clear(Calendar.MINUTE);
         calLast.clear(Calendar.SECOND);
         calLast.clear(Calendar.MILLISECOND);

         long millisPerDay = 86400000; // 24 * 60 * 60 * 1000
         long millisDelta = calNow.getTime().getTime() - calLast.getTime().getTime();

View Full Code Here

         calLast.clear(Calendar.AM_PM);
         calLast.clear(Calendar.HOUR);
         calLast.clear(Calendar.HOUR_OF_DAY);
         calLast.clear(Calendar.MINUTE);
         calLast.clear(Calendar.SECOND);
         calLast.clear(Calendar.MILLISECOND);

         long millisPerDay = 86400000; // 24 * 60 * 60 * 1000
         long millisDelta = calNow.getTime().getTime() - calLast.getTime().getTime();

         int dayDelta = (int) (millisDelta / millisPerDay);
View Full Code Here

    cal.set(2006, Calendar.JULY, 30);
    cal.setLenient(false);

    harness.check(cal.getMaximum(Calendar.WEEK_OF_MONTH), 6);

    cal.clear(Calendar.DAY_OF_MONTH);
    cal.set(Calendar.WEEK_OF_MONTH, 1);
    cal.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
    harness.check(cal.get(Calendar.DAY_OF_MONTH), 1);

    cal.clear(Calendar.DAY_OF_MONTH);
View Full Code Here

    cal.clear(Calendar.DAY_OF_MONTH);
    cal.set(Calendar.WEEK_OF_MONTH, 1);
    cal.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
    harness.check(cal.get(Calendar.DAY_OF_MONTH), 1);

    cal.clear(Calendar.DAY_OF_MONTH);
    cal.set(Calendar.WEEK_OF_MONTH, 6);
    cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
    harness.check(cal.get(Calendar.DAY_OF_MONTH), 31);

    // Month with 4 weeks
View Full Code Here

    cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
    harness.check(cal.get(Calendar.DAY_OF_MONTH), 31);

    // Month with 4 weeks
    cal.set(1998, Calendar.FEBRUARY, 14);
    cal.clear(Calendar.DAY_OF_MONTH);
    cal.set(Calendar.WEEK_OF_MONTH, 1);
    cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
    harness.check(cal.get(Calendar.DAY_OF_MONTH), 1);
   
    cal.clear(Calendar.DAY_OF_MONTH);
View Full Code Here

    cal.clear(Calendar.DAY_OF_MONTH);
    cal.set(Calendar.WEEK_OF_MONTH, 1);
    cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
    harness.check(cal.get(Calendar.DAY_OF_MONTH), 1);
   
    cal.clear(Calendar.DAY_OF_MONTH);
    cal.set(Calendar.WEEK_OF_MONTH, 4);
    cal.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
    harness.check(cal.get(Calendar.DAY_OF_MONTH), 28);
    harness.check(cal.get(Calendar.MONTH), Calendar.FEBRUARY);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.