Java Date and Time

  • + 0 comments
    // SimpleDateFormat with the pattern "EEEE" formats the date into the full name of the day
    
    public static String findDay(int month, int day, int year) {
            Calendar c = Calendar.getInstance();
            c.set(year, month-1, day);
            
            return new java.text.SimpleDateFormat("EEEE", Locale.ENGLISH).format(c.getTime()).toUpperCase();
            
    
        }