Results 1 to 3 of 3
  1. #1
    toterpunkt is offline Member
    Join Date
    Feb 2011
    Posts
    6
    Rep Power
    0

    Default Time Calculation Assistance

    I am trying to get my clock program to figure out the amount of time that has passed when a user enters the time in a military format.

    How would i make it so it recognizes how much time has passed if the user enters the start time and then enters an end time that is less than the start time. EX. startTime = 1400 & endTime = 1300


    My output keeps reading:

    New Start Time: 1600
    New Ending Time: 1130

    Exactly -4 hour(s) and -50 minute(s) have passed.
    Last edited by toterpunkt; 02-17-2011 at 07:47 AM.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    just do 24 - larger time, and then add the lower time to it.

    so 1600 and 1100 would be 1900.

  3. #3
    toterpunkt is offline Member
    Join Date
    Feb 2011
    Posts
    6
    Rep Power
    0

    Default

    Quote Originally Posted by sunde887 View Post
    just do 24 - larger time, and then add the lower time to it.

    so 1600 and 1100 would be 1900.
    I'm not very good with java, i added what you advised to the very end. Did i even put it in there correctly? I've been staring at this code for so long i keep hitting mind blanks repeatedly. Will i know have to create all of my get methods all over again to fit with the new method i added at the end so that i can call it in my tester to make it print out the statement O_o? Am I even "close"

    Code and Tester are on paste bin if anyone can take a look at my mess:

    http://pastebin.com/SLAvQ8yk
    Last edited by toterpunkt; 02-17-2011 at 07:48 AM.

Similar Threads

  1. Replies: 3
    Last Post: 08-23-2011, 01:46 PM
  2. Assistance about this.
    By Syfer in forum Advanced Java
    Replies: 38
    Last Post: 06-21-2010, 06:59 PM
  3. Looking for assistance
    By s_dawg101 in forum New To Java
    Replies: 32
    Last Post: 11-04-2009, 03:49 AM
  4. In need of some assistance
    By Boer84 in forum New To Java
    Replies: 2
    Last Post: 07-08-2008, 05:14 PM
  5. Problem with Calculation ....
    By danny000 in forum New To Java
    Replies: 1
    Last Post: 04-15-2008, 03:42 PM

Posting Permissions

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