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: 
There is a challenge on hackerrank [Java Date and Time](https://www.hackerrank.com/challenges/java-date-and-time/problem) 

personally, I prefer the LocalDate class.

1. Import java.time.LocalDate
2. Retrieve localDate by using "of" method which takes 3 arguments in
"int" format.
3. finally, get the name of that day using "getDayOfWeek" method.

There is one video on this challenge.

[Java Date and Time Hackerrank solution](https://www.youtube.com/watch?v=6eiN_1P0Hk8&lc=Ugxd6MOR80mcO7XjU_R4AaABAg)

I hope it will help :)
```
LocalDate date=LocalDate.now();

System.out.println(date.getDayOfWeek());//prints THURSDAY
System.out.println(date.getDayOfWeek().getDisplayName(TextStyle.SHORT, Locale.US) );  //prints Thu   
java.time.DayOfWeek is a enum which returns the singleton instance for the day-of-week of the weekday of the date.

```