Question: For Example I have the date: "23/2/2010" (23th Feb 2010). I want to pass it to a function which would return the **day of week**. How can I do this?

In this example, the function should return `String` "Tue".

Additionally, if just the day ordinal is desired, how can that be retrieved?

Answer: 
```
//to get day of any date

import java.util.Scanner; 
import java.util.Calendar; 
import java.util.Date;

public class Show {

    public static String getDay(String day,String month, String year){

            String input_date = month+"/"+day+"/"+year;

            Date now = new Date(input_date);
            Calendar calendar = Calendar.getInstance();
            calendar.setTime(now);
            int final_day = (calendar.get(Calendar.DAY_OF_WEEK));

            String finalDay[]={"SUNDAY","MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY"};

            System.out.println(finalDay[final_day-1]);

    }

    public static void main(String[] args) { 
            Scanner in = new Scanner(System.in); 
            String month = in.next(); 
        String day = in.next();
            String year = in.next();

            getDay(day, month, year);
    }

}

```
Get a Date for Today and then Find a week Day from it.

```
    LocalDate d = java.time.LocalDate.now();
    System.out.println(java.time.LocalDate.now()); 

    Calendar c = Calendar.getInstance();
    int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
    System.out.println(dayOfWeek);

```