• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to calculate the sum of time  RSS feed

 
Omar Ali
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I am having a jsp which is reading the total hours for each employee. However, I am reading their total hours from the DB and would like to sum the time at the grand total.

I tried to use:


But, an error is occurred that can not sum the time variable. So, how can I do that?

My code in the jsp is:


An example of the output:

7:15:00
0015:00

What I would like is
Grand Total = 7:30:00

Thanks for the help
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing to do with JSP/ Moved to a more appropriate location.
 
Unnar Björnsson
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use the Calendar.add()
or you could use:
 
Omar Ali
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

I should use this code in the while loop?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!