Format day of week in EEEE format like Sunday, Monday etc in Java
Description
The following code shows how to format day of week in EEEE format like Sunday, Monday etc.
Example
/* ww w .j a v a2 s. c o m*/
import java.text.SimpleDateFormat;
import java.util.Date;
public class Main {
public static void main(String[] args) {
String strDateFormat = "EEEE";
SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
System.out.println("Current day of week in EEEE format : " + sdf.format(new Date()));
}
}
The code above generates the following result.