Code example for GregorianCalendar

Methods: clear, get, setTimeInMillis

0
        } catch (IllegalArgumentException expected) { 
        } 
    } 
 
    public void test_computeFields() { 
        GregorianCalendar g = new GregorianCalendar( 
            TimeZone.getTimeZone("Europe/London"), 
            new Locale("en", "GB")); 
        g.clear(); 
        g.setTimeInMillis(1222185600225L); 
        assertEquals(1,                  g.get(Calendar.ERA)); 
        assertEquals(2008, g.get(Calendar.YEAR)); 
        assertEquals(Calendar.SEPTEMBER, g.get(Calendar.MONTH)); 
        assertEquals(23,                 g.get(Calendar.DAY_OF_MONTH)); 
        assertEquals(17,                 g.get(Calendar.HOUR_OF_DAY)); 
        assertEquals(0, g.get(Calendar.MINUTE)); 
    } 
 
    public void test_hashCode() { 
        GregorianCalendar g = new GregorianCalendar( 
                TimeZone.getTimeZone("Europe/London"),