Package java.util

Examples of java.util.Calendar.clear()


      }

      //===== WALK the dates that are described in the freq/interval.  Also fill in any
      //===== sets that are required at each level
      Calendar cur = Calendar.getInstance();
      cur.clear();
      cur.setLenient(false);
      Calendar limit = Calendar.getInstance();
      limit.clear();
      limit.setLenient(false);
      limit.setTime(end);
View Full Code Here


      //===== sets that are required at each level
      Calendar cur = Calendar.getInstance();
      cur.clear();
      cur.setLenient(false);
      Calendar limit = Calendar.getInstance();
      limit.clear();
      limit.setLenient(false);
      limit.setTime(end);

      //----------------- Build the year list
      cur.setTime( start );
View Full Code Here


      resultList = new ArrayList();
      Calendar result = Calendar.getInstance();
      result.setLenient(false);
      result.clear();

/*
      if ( TestRecurrance.debug ){
        println("pS   "+protoDateList.size());
        println("yS   "+yearSet.size()+"  "+yearSet);
View Full Code Here

        TimeZone userTimeZone = TimeZone.getTimeZone(userTimeZoneId);
        Calendar now = Calendar.getInstance(userTimeZone, locale);
        // round up the hour if we are at the 1 minute mark of the hour or
        // higher. just clear the second and millisecond fields, its only
        // scheduling not physics.
        now.clear(Calendar.SECOND);
        now.clear(Calendar.MILLISECOND);
        if (now.get(Calendar.MINUTE) > 0) {
          now.clear(Calendar.MINUTE);
          now.add(Calendar.HOUR, 1);
        }
View Full Code Here

        Calendar now = Calendar.getInstance(userTimeZone, locale);
        // round up the hour if we are at the 1 minute mark of the hour or
        // higher. just clear the second and millisecond fields, its only
        // scheduling not physics.
        now.clear(Calendar.SECOND);
        now.clear(Calendar.MILLISECOND);
        if (now.get(Calendar.MINUTE) > 0) {
          now.clear(Calendar.MINUTE);
          now.add(Calendar.HOUR, 1);
        }
        activityForm.setActivityStartDate(df.format(now.getTime()));
View Full Code Here

        // higher. just clear the second and millisecond fields, its only
        // scheduling not physics.
        now.clear(Calendar.SECOND);
        now.clear(Calendar.MILLISECOND);
        if (now.get(Calendar.MINUTE) > 0) {
          now.clear(Calendar.MINUTE);
          now.add(Calendar.HOUR, 1);
        }
        activityForm.setActivityStartDate(df.format(now.getTime()));
        activityForm.setActivityStartTime(tf.format(now.getTime()));
        // Increment now by 1 hour to get the end time.
View Full Code Here

        Calendar cal = Calendar.getInstance();
        cal.set(2004, Calendar.DECEMBER, 31, 0, 0, 0);
        cal.set(Calendar.MILLISECOND, 0);
        Timestamp t1 = new Timestamp(cal.getTime().getTime());
        cal.clear();
        cal.set(2004, Calendar.AUGUST, 1, 0, 0, 0);
        cal.set(Calendar.MILLISECOND, 0);
        Timestamp t2 = new Timestamp(cal.getTime().getTime());
       
        // Create expected results
View Full Code Here

            c = getCalendar();
        } else {
            c = Calendar.getInstance(tz);
        }
        synchronized (c) {
            c.clear();
            c.setLenient(lenient);
            if (year <= 0) {
                c.set(Calendar.ERA, GregorianCalendar.BC);
                c.set(Calendar.YEAR, 1 - year);
            } else {
View Full Code Here

     * @return the date value
     */
    public static long dateValueFromDate(long ms) {
        Calendar cal = getCalendar();
        synchronized (cal) {
            cal.clear();
            cal.setTimeInMillis(ms);
            int year, month, day;
            year = getYear(cal);
            month = cal.get(Calendar.MONTH) + 1;
            day = cal.get(Calendar.DAY_OF_MONTH);
View Full Code Here

     * @return the date value
     */
    public static long nanosFromDate(long ms) {
        Calendar cal = getCalendar();
        synchronized (cal) {
            cal.clear();
            cal.setTimeInMillis(ms);
            int h = cal.get(Calendar.HOUR_OF_DAY);
            int m = cal.get(Calendar.MINUTE);
            int s = cal.get(Calendar.SECOND);
            int millis = cal.get(Calendar.MILLISECOND);
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.