Be a Knowm.org sponsor

Please contact us or leave a comment if you would like to sponsor this page.

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:

Are you interested in the cutting edge of AI processors? Read how to build the Ex-Machina Wetware Brain and learn about the Knowm Technology Stack.

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.

4 Comments

Leave a Comment

Knowm 32X32 Crossbar

Knowm Newsletter

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