Code example for ChoiceFormat

0
 
    private static final ChoiceFormat MINUTES_FORMAT =
            new ChoiceFormat(LIMITS, MINUTES_PART);
 
    private static final ChoiceFormat SECONDS_FORMAT =
            new ChoiceFormat(LIMITS, SECONDS_PART);
 
    static { 
        MINUTE_SECONDS.setFormat(0, MINUTES_FORMAT);
        MINUTE_SECONDS.setFormat(1, SECONDS_FORMAT);
    } 
 
    /** private constructor */ 
    private DateUtils() { 
    } 
 
 
    /** 
     * Format a date/time into a specific pattern. 
     * @param date the date to format expressed in milliseconds. 
     * @param pattern the pattern to use to format the date.