Java Date and Time

  • + 3 comments

    Scanner in = new Scanner(System.in); int month = in.nextInt() - 1; int day = in.nextInt(); int year = in.nextInt();

        Date date = (new GregorianCalendar(year, month, day)).getTime();
        SimpleDateFormat f = new SimpleDateFormat("EEEE");
        String day2 = f.format(date);
        System.out.println(day2.toUpperCase());