Results 1 to 9 of 9

Thread: Formatting Time?

Threaded View

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Formatting Time?

    Im trying to create a timer that executes in a seperate thread but i have no clue how to go about formatting the time in h:m:s format. I tried using the java.util.Timer and java.util.TimerTask classes but they are a pain to use so i decided just to use an infinite loop. Thanks
    Code:
    spawnTimerThread(); 
    
    
    public void spawnTimerThread(){
     DateFormat df = DateFormat.getTimeInstance();
      // how do i format to h:m:s
    
     Thread timer = new Thread(); 
      t.setDemon(true); // let the vm exit; 
     for(;;){
        timer.sleep(1000);
        // how would i increment the fields
      }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width