Code example for SimpleDateFormat

Methods: applyPattern, format, setTimeZone

0
                    format.format(date));
        } 
    } 
 
    /** 
     * java.text.SimpleDateFormat#SimpleDateFormat(java.lang.String, 
     *        java.text.DateFormatSymbols) 
     */ 
    public void test_ConstructorLjava_lang_StringLjava_text_DateFormatSymbols() { 
        // Test for method java.text.SimpleDateFormat(java.lang.String, 
        // java.text.DateFormatSymbols) 
        DateFormatSymbols symbols = new DateFormatSymbols(Locale.ENGLISH);
        symbols.setEras(new String[] { "Before", "After" });
        SimpleDateFormat f2 = new SimpleDateFormat("y'y'yy", symbols);
        assertTrue("Wrong class", f2.getClass() == SimpleDateFormat.class);
        assertEquals("Wrong pattern", "y'y'yy", f2.toPattern());
        assertTrue("Wrong symbols", f2.getDateFormatSymbols().equals(symbols));
        assertTrue("Doesn't work",
                f2.format(new Date()).getClass() == String.class);
 
        try {