Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to retrieve day, month and year in jsp

Status
Not open for further replies.

arm207

Programmer
Jun 13, 2006
26
0
0
US
how can I retrieve day, month and year in jsp?
 
Hi

Code:
[red]<%@page import="java.util.Calendar" %>[/red]
<html>
<body>

Current date's parts are :

[red]<%

Calendar c=Calendar.getInstance();

out.println("Day : "+c.get(Calendar.DAY_OF_MONTH)+"<br>");
out.println("Month : "+c.get(Calendar.MONTH)+"<br>");
out.println("Year : "+c.get(Calendar.YEAR)+"<br>");

%>[/red]

</body>
</html>

Feherke.
 
As Feherke showed you in his code, it is like "regular" java, no special method for jsp...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top