How to get the name of the day in Java

1 Answer

0 votes
package javaapplication1;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Example {
    
    public static void main(String[] args) {
       
    	String nameOfTheDay = new SimpleDateFormat("EEEE").format(new Date());
        System.out.println(nameOfTheDay);
    }
}
   
   
/*
run:

Sunday
    
*/

 



answered Jan 24, 2016 by avibootz

Related questions

1 answer 199 views
1 answer 108 views
1 answer 116 views
1 answer 119 views
1 answer 109 views
...