I am running a web application from eclipse. On this web application I want to set the current date and time to 24/11/1992. 00:00 hrs GMT. After this I want the application to auto increment the time and keep a track of the date,month and year. Is there any way i can do this in Java/JSP?
Share
You should store the difference between the “real current time” and the “past current time”, and do a subtraction each time you want to check the past time:
The two
printlnshall print something likeTue Nov 24 00:00:00 BRST 1992andTue Nov 24 00:00:02 BRST 1992(depending on your locale).There’s no need to “auto increment”, there’s no multithreading, the class is immutable (hence inherently thread-safe) and very, very clean.