Code example for SimpleDateFormat

Methods: format, getClass, getDateFormatSymbols, toPattern

0
                f2.format(new Date()).getClass() == String.class);
 
        try { 
            new SimpleDateFormat(null, Locale.GERMAN);
            fail("NullPointerException was not thrown.");
        } catch(NullPointerException npe) {
            //expected 
        } 
        try { 
            new SimpleDateFormat("eee", Locale.GERMAN);
            fail("IllegalArgumentException was not thrown.");
        } catch(IllegalArgumentException iae) {
            //expected 
        } 
    } 
 
    public void test_applyLocalizedPatternLjava_lang_String() { 
        // Test for method void 
        // java.text.SimpleDateFormat.applyLocalizedPattern(java.lang.String) 
        SimpleDateFormat f2 = new SimpleDateFormat("y", new Locale("de", "CH"));
        // BEGIN android-removed