Code example for GregorianCalendar

Methods: getTimeInMillisset

0
        Long endTime = endCalendar.getTimeInMillis();
        cv.put(Events.RRULE, "FREQ=WEEKLY;BYDAY=MO");
        p.setTimeRelatedValues(cv, startTime, endTime, 1);
 
        // The start time should have hour/min/sec zero'd out 
        startCalendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
        startCalendar.set(2010, 5, 10, 0, 0, 0);
        startCalendar.set(GregorianCalendar.MILLISECOND, 0);
        startTime = startCalendar.getTimeInMillis();
        assertEquals(startTime, cv.getAsLong(Events.DTSTART));
 
        // The duration should be in days 
        assertEquals("P1D", cv.getAsString(Events.DURATION));
        assertNull(cv.getAsLong(Events.DTEND));
        assertNull(cv.getAsLong(Events.LAST_DATE));
        // There must be a timezone 
        assertNotNull(cv.getAsString(Events.EVENT_TIMEZONE));
    } 
 
    public void testSetTimeRelatedValues_Recurring_AllDay_Exception () throws IOException { 
Stop searching for code, let great code find you!  Add Codota to your java IDE