• Post Reply Bookmark Topic Watch Topic
  • New Topic

Set Time..

 
padmshree Patil
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I wanted to show time left in .jsp page.How to do?
Time should decrement (start time 1hr:30 min )
thanks,
padmashree
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question would probably get better response in the Servlet JSP Forum. I'm going to move it there.
 
padmshree Patil
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will greatfull to u if my problem solved.
I am all most done with Online test system.
Thanks..
-padmashree
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by 'show time left' in your page. The time left for what? It's easy enough to spit out a SimpleDateFormat, but that time comes from somewhere.
 
padmshree Patil
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Hildner:
What do you mean by 'show time left' in your page. The time left for what? It's easy enough to spit out a SimpleDateFormat, but that time comes from somewhere.

I wanted to set Exam time, say 1:30 min.I wanted to diaplay this on top of Online test page.Timmer should go from 1:30 to 1:29 and so on till timeout or user clicks finish button
I know with Date.getHours() and getMinutes() we can getcurrent time .How I can set my own timer

[This message has been edited by padmshree Patil (edited February 13, 2001).]
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are probably lots of ways to do this, one that comes to mind is to have an instance variable that is the finish time (time + 1:30) and then you could compare current time to finish time.
If your exam spans several pages, you could either pass the value or use a bean and get it from there (any other ideas, please post).
If this is just jsp, the time will be static on the page - showing the time left when the servlet generated the page. If you need to show a running clock, I think you need an applet.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also do it with JavaScript which the JSP could put on the page.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!