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 8045513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:34:18+00:00 2026-06-05T05:34:18+00:00

i have one application which get the start and end time from the user

  • 0

i have one application which get the start and end time from the user and start the particular process at (start time) runs upto the (end time),for sample i use TimerTask utility in case it only start the process from the current time and runs upto (end time) i cant set the start time how do i comapare the user time(start time) and system time in java

//my sample  program
import java.sql.Date;
import java.util.Timer;
import java.util.TimerTask;

public class Main {
  public static void main(String[] argv) throws Exception {

     int numberOfMillisecondsInTheFuture=1000;

//    start time= dynamically set by user
//    end time =dynamically set by user


    Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture);//here is the problem.
    Timer timer = new Timer();

    timer.schedule(new TimerTask() {
      public void run() {

      //System.out.println("doing");
      //doing some task not related to this question
      }
    }, timeToRun);
  }
  • 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-05T05:34:20+00:00Added an answer on June 5, 2026 at 5:34 am

    if this helps
    How i can run my TimerTask everyday 2 PM
    You may have to do some changes to fit to your use.

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

Sidebar

Related Questions

I have an application which obtains data in JSON format from one of our
I have an application which upon start request around 10-12KB of data from server
In my application , I have to get date from the user. First I
i have one application which is build using VB.NET now i required to add
I have one desktop application which was implemented in C#. This app uploads file
The problem: we have one application that has a portion which is used by
My application is viewbased application in which I have one button. On click of
I have a Java application which requires certain software (one of them being Perl)
I have a one page web application, which means alot of javascript. External scripts
I have an application which consists of 2 pages. One of those pages generates

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.