Code example for SimpleDateFormat

Methods: parse, toPattern

0
        } catch (NumberFormatException e)
        { 
        } 
 
        // try date 
        SimpleDateFormat df = (aDateFormat != null) ? aDateFormat : new SimpleDateFormat("MM/dd/yyyy hh:mm a", Locale.US);
 
        try 
        { 
            Date revisionDate = df.parse(revision);
            return new SVNRevision.DateSpec(revisionDate);
        } catch (ParseException e)
        { 
        } 
         
        throw new ParseException("Invalid revision. Revision should be a number, a date in " + df.toPattern() + " format or HEAD, BASE, COMMITED or PREV",0);
    }     
 
    /** 
     * get a revision from a string 
     * revision can be :