You are viewing a single comment's thread. Return to all comments →
public static void main(String[] args) throws ParseException {
Scanner in = new Scanner(System.in); String month = in.next(); String day = in.next(); String year = in.next(); String inputDateStr = String.format("%s/%s/%s", day, month, year); Date inputDate = new SimpleDateFormat("dd/MM/yyyy").parse(inputDateStr); Calendar calendar = Calendar.getInstance(); calendar.setTime(inputDate); String dayOfWeek = calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, Locale.US).toUpperCase(); System.out.println(dayOfWeek); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Date and Time
You are viewing a single comment's thread. Return to all comments →
public static void main(String[] args) throws ParseException {