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.

2 Comments

    • Avatar
      ravi
      reply

      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

Newsletter

Subscribe to our low-volume mailing list to receive important updates and announcements directly in your inbox.