Code example for Time

Methods: normalize, set, setJulianDay, toMillis

0
        } 
    } 
 
    @Test 
    public void testSetJulianDay() throws Exception { 
        Time time = new Time();
        time.set(0, 0, 0, 12, 5, 2008);
        time.timezone = "Australia/Sydney";
        long millis = time.normalize(true);
 
        int julianDay = Time.getJulianDay(millis, time.gmtoff);
        time.setJulianDay(julianDay);
 
        assertTrue(time.hour == 0 || time.hour == 1);
        assertEquals(0, time.minute);
        assertEquals(0, time.second);
 
        millis = time.toMillis(false);
        int day = Time.getJulianDay(millis, time.gmtoff);
 
        assertEquals(day, julianDay);
    } 
}