Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8626785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:06:59+00:00 2026-06-12T08:06:59+00:00

I am running a web application from eclipse. On this web application I want

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:07:00+00:00Added an answer on June 12, 2026 at 8:07 am

    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:

    final class Past {
      private final long differenceMs;
      public Past(final Date pastDate) {
        this.differenceMs = (System.currentTimeMillis() - pastDate.getTime());
      }
      public Date getUpdatedPastDate() {
        return new Date(System.currentTimeMillis() - differenceMs);
      }
    }
    
    class Test {
      public static void main(String[] args) throws Throwable {
        final Calendar cal = Calendar.getInstance();
        cal.set(1992, 10, 24, 0, 0, 0); // this is 24/11/1992
        final Past past = new Past(cal.getTime());
        System.out.println(past.getUpdatedPastDate());
        Thread.sleep(2000);
        System.out.println(past.getUpdatedPastDate());
      }
    }
    

    The two println shall print something like Tue Nov 24 00:00:00 BRST 1992 and Tue 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application running on Windows IIS. This app has a database
I have a j2ee web application running on Spring framework. I want to implement
When I try to terminate my GWT based web application from within Eclipse ,
I am having an asp.net 2.0 web application running from Visual studio 2005. The
I am debugging a java web application running on JBoss 6 using Eclipse. I
I have a web application running in Eclipse with Tomcat. It has a few
I'm having trouble running my spring project from inside Eclipse. This is the error
I've made a Google Web Application Project in Eclipse and am now running into
if i have a web application running from a yaws web server, how would
I have an ASP.NET MVC web application running from http://localhost/myappname . From jQuery, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.