Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Date in JSP 
 

To print a Date in JSP firstly we are importing a class named java.util.Date of the package java.util.

 

Date in JSP

                          

To print a Date in JSP firstly we are importing a class named java.util.Date of the package java.util. This package is imported in the jsp page so that the Date class and its properties can accessed in the JSP page. To import a package we need to use page directive inside which we will use its one of its attributes named import which is used for importing the class and package.

To print the current date we are using a expression directive in which we are creating a object of Date class. We have used toString() method to convert Date type to String.

 

The output of the program is given below:

 

 

<%@ page import ="java.util.Date" %>
<html>
	<head>
		<title>The current date is</title>
	</head>
		<body>
		<font size = 6 color = "#FF0000">current date is 
                 :<%= new Date().toString()%></font>
		</body>
</html>

The output of the program is given below:

Download this example:

                          

» View all related tutorials
Related Tags: java c library error ide io vi core tag lock this id action block write invoke like handle if solution

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

1 comments so far (
post your own) View All Comments Latest 10 Comments:

day:
month:
year:

Posted by Alia on Saturday, 12.6.08 @ 23:35pm | #82476

Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.