Here the program to display the date is given by executing this program we can get current date and time. Here the program shows you how to create a simple dynamic JSP page that prints the current date and time.
So the following code accomplish this:
<%@page contentType="text/html" import="java.util.*" %>
<table border="0" cellpadding="0" cellspacing="0" width="460" bgcolor="#EEFFCA">
<td width="100%"><font size="6" color="#008000"> Date Example</font></td>
<td width="100%"><b> Current Date and time is: <font color="#FF0000">
<%= new java.util.Date() %>
The main concept in this program is Date() function
of the java.util package which returns the current data and time.
In the JSP Declaratives
contentType="text/html" import="java.util.*" %>
we are importing the java.util
package and following JSP Expression code
new java.util.Date() %>
1. hi i want to show the Calendar in text field when the user enter into that text box please help me o
View Tutorial By: shivanaik at 2017-05-01 14:55:18
this is giving me the Mon Jul
View Tutorial By: bindu at 2016-06-23 05:26:15
8. This code works for me. But i have a doubt how to develop a Ajax program that gets the user input f
View Tutorial By: Daya at 2015-05-04 12:04:19
9. I keep listening to the news update lecture about receiving boundless online grant applications so I
View Tutorial By: Smithg960 at 2014-05-23 06:59:03
10. It is very helpful, I searched in many websites, but this post helped me the most to show date in js
View Tutorial By: Anil Vaja at 2013-10-14 17:21:42
11. Can Some body help me??
i want To show date like "29. Apr 2013"
i m using Fo
View Tutorial By: saif at 2013-04-29 09:22:31
15. Hey i see some lines of code in order to displpay the system time where server is in another timezon
View Tutorial By: Bala at 2013-01-09 13:58:48
16. only last code is gud one (DateFormat )... otherwise all is rubbish...
View Tutorial By: Gaurav at 2013-01-04 09:18:43
17. I just want to fetch system date without timing so how can i do that?
View Tutorial By: dhanashri at 2012-04-04 02:09:36
DateFormat date = DateFormat.getDateInstance
View Tutorial By: saifuctg at 2011-12-30 22:24:54
20. dai yaruda intha endu peru kaify and sooraj??? en kaiyla rendu perum kedachinga .................
View Tutorial By: sreelatha at 2011-10-03 09:31:54
22. What is this....for simple question every one was commenting.....and unnecessarily praising...gud co
View Tutorial By: Kaify at 2011-07-27 21:36:25
23. What is this....for simple question every one was commenting.....and unnecessarily praising...gud co
View Tutorial By: Kaify at 2011-07-27 21:35:55
24. What is this....for simple question every one was commenting.....and unnecessarily praising...gud co
View Tutorial By: Kaify at 2011-07-27 21:35:52
25. can we print only second by using the date function?
View Tutorial By: mukesh kumar at 2011-07-27 02:31:02
28. hi.. how can i extrate day, month, year from date function
View Tutorial By: avkash at 2010-10-03 05:19:58
30. Hello every body, i have made different codes of JSP page but i am getting trouble on GOOGLE CHROME
View Tutorial By: Sajjad Ali at 2010-07-27 03:50:16
31. Easiest way is to rearrange the date obtained to the format in which we can save in the backend.
View Tutorial By: Shahzad at 2010-07-11 21:15:14
32. hey...i have a problem getting the system date in jsp and putting that date back into the oracle dat
View Tutorial By: angel at 2010-04-03 09:27:38
View Tutorial By: pmprash at 2009-12-22 01:15:33
34. I have my application running on server that is there in some other time zone. I need to display the
View Tutorial By: vitamin b12 at 2009-12-04 10:51:56
36. Thanks for the code it save's me a lot of work, however how can i delete the timezone.
View Tutorial By: Wishkah at 2009-09-04 00:29:16
37. Hi Binod,
Since JSP code is executed at the server side before sending back to the br
View Tutorial By: Aathi at 2009-05-28 21:20:10
38. Thanks for good atricle. But this code will always show the client page time NOT server current time
View Tutorial By: Binod Suman at 2009-05-28 09:40:48
39. Thanks for good atricle. But this code will always show the client page time NOT server current time
View Tutorial By: Binod Suman at 2009-05-28 09:36:24
40. Yes it is exactly same as HTML. No change. In fact you can convert any existing HTML page to a JSP p
View Tutorial By: aathishankaran at 2008-08-03 05:22:38
41. This code was quite helpful .I wud like to ask code for making text fields for username and password
View Tutorial By: Namrata at 2008-08-03 04:09:06
Most Viewed Articles (in JSP )
Latest Articles (in JSP)
Comment on this tutorial
- Data Science
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews