Code example for DateFormatSymbols

Methods: getMonths

0
    } 
 
    public static String month(Date date, Locale locale) {
        Calendar c = Calendar.getInstance(locale);
        c.setTime(date);
        DateFormatSymbols symbols = new DateFormatSymbols(locale);
        return symbols.getMonths()[c.get(Calendar.MONTH)];
    } 
 
    public static int year(Date date) {
        Calendar c = Calendar.getInstance();
        c.setTime(date);
        return c.get(Calendar.YEAR);
    } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java