Code example for SimpleDateFormat

Methods: getClassformatgetDateFormatSymbolstoPattern

0
        try { 
            new SimpleDateFormat(null, symbols);
            fail("NullPointerException was not thrown.");
        } catch(NullPointerException npe) {
            //expected 
        } 
 
        try { 
            new SimpleDateFormat("eee", symbols);
            fail("IllegalArgumentException was not thrown.");
        } catch(IllegalArgumentException iae) {
            //expected 
        } 
    } 
 
    public void test_ConstructorLjava_lang_StringLjava_util_Locale() { 
        // Test for method java.text.SimpleDateFormat(java.lang.String, 
        // java.util.Locale) 
        SimpleDateFormat f2 = new SimpleDateFormat("'yyyy' MM yy",
                Locale.GERMAN);
Stop searching for code, let great code find you!  Add Codota to your java IDE