This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
so please give me the solution
not any such that move it to other page like that
when i got my solution i delete this post
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35253
7
posted
0
Calculating a value in a JSP page is quite different from using a value in a JSP. The value can be calculated in some backing bean or servlet, and then put into the page context as attribute.
Start by looking at the SimpleDateFormat class, which has methods to parse a string into a Date object. Then you can work with the Date methods to calculate the difference in days.
deep raj
Ranch Hand
Joined: Dec 11, 2009
Posts: 186
posted
0
okay i will make bean and calculate date differences in days using two date objects
but the problem is that
the two dates are retrieved from database
so how can these values send to bean class
i think it is not possible
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35253
7
posted
0
Then do it in the servlet, or one of the classes that it instantiates.
Ulf Dittmer wrote:Then you can work with the Date methods to calculate the difference in days.
I think you mean Calendar methods. Date only has a number of milliseconds since Janyary 1st 1970. Because of nasty things like daylight savings time there are days with 23 or 25 hours so simple calculation does not apply.
Fortunately this question has been asked and answered several times before so a search should provide enough help.