Java_LogoTo get the day of the week from a java.util.Date object, we can use the java.text.SimpleDateFormat class. First, create a Date object. Next, create a SimpleDateFormat instance using the getDateInstance() method, passing the String “E” or “EEEE” as the argument. Get the day of the week as a String using the format() method passing in the java.util.Date object. To get the weekday in numerical format, we can use the java.util.Calendar object’s get method passing in Calendar.DAY_OF_WEEK.

Get Day of Week from Date in Java – Example Code

Here is the output of the example code for getting the day of the week:

Knowm Sundial Job Scheduling

Knowm Yank JDBC Persistance

Related Posts

Subscribe To Our Newsletter

Join our low volume mailing list to receive the latest news and updates from our team.


    • Avatar

      what if we have to provide our specific date i.e,without taking current date i want to give some random date like 08 05 2015

Leave a Comment

Knowm Newsletter

Are you ready for memristor AI processors? With our newsletter, you will be.