joett
asked on
Data format YYYY-MM-DD
Hi, I am tring to insert a date in my JSP page. But what I can do is only <%=new java.util.Date()%> which result in a long string (like Mon Mar 03 00:09:54 PST 2003).
I wonder if I can have something short like YYYY-MM-DD or DD-MM-YYYY whatever.
Many thanks.
I wonder if I can have something short like YYYY-MM-DD or DD-MM-YYYY whatever.
Many thanks.
woops, should be:
<%
java.text.SimpleDateFormat df = new java.text.SimpleDateFormat ("yyyy-MM- dd");
%>
<%= df.format(new java.util.Date()) %>
<%
java.text.SimpleDateFormat
%>
<%= df.format(new java.util.Date()) %>
ASKER
Is it possible to add a week day there? like Monday, Tuesday?
thanks.
thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I answer your original question, and you go and accept someone elses comment???
ASKER
hi, objects, i am sorry. i would like to spilt my points if i could. but thanasis did solved my problem.
java.text.SimpleDateFormat
%>
<%= df.format(new java.util.Date()) %>