Simple Date Format Day in Week Example in java

This example show you how to get Current day of the week in full name using SimpleDateFormat object, you can use the format as “EEEEEEEEEEEE” to get the Week day value in full name.

import java.text.SimpleDateFormat;
import java.util.Calendar;
public class SimpleDateFormatDayInWeekExample {
    public static void main(String[] args) {
        // Get the simple date format object by passing the format in string
        SimpleDateFormat format = new SimpleDateFormat("EEEEEEEEEE");
        // get the date in String format by passing current date
        // in format method of simple date format object
        Calendar date = Calendar.getInstance();
        String dateString = format.format(date.getTime());
        // Print the formated date.
        System.out.println("The Current day in week is : " + dateString);

The output of the above example will be as:

The Current day in week is : Saturday