java - How can i get the name of day from a date in JSP -


hi trying day name date, date come page in format (dd,mm,yyyy) , code name of day date. tried:

<%@ page import="java.io.*,java.util.*" %> <%@ page import="javax.servlet.*,java.text.*" %> <%     line >> date date = new date(request.getparameter("date"));     simpledateformat ft = new simpledateformat ("e");     out.print( "<h2 align=\"left\">" +ft.format(date) +"</h2>"); %> 

public date(string s) deprecated.

so should this:

simpledateformat sdf=new simpledateformat("dd/mm/yyyy"); // input date format date date = sdf.parse(request.getparameter("date"));  simpledateformat ft =  new simpledateformat ("eeee");  out.print( "<h2 align=\"left\">" +ft.format(date) +"</h2>"); 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -