|
-
Apr 18th, 2012, 05:36 AM
#1
Thread Starter
Fanatic Member
Time Difference
Hi guys.
I can't seem to find a proper code for getting the time difference.
This is the flow of the program:
1.) Input Time-in. (Should be in "0000" format. Example: "0800" [stands for 8:00 AM] )
2.) Input Time-out. (Example: "1700" [stands for 5:00 PM])
3.) Output the number of hours. (8 hours would be in this case)
The problem is with the minutes. In the flow of the code, i would normally go with "End - Start" and then divide with 100 to get the total number of hours. But if the first input is "759" (which stands for "7:59 AM") and the second input is "1702" (which stands for "5:02" PM), I always gets a result of "943" which is wrong and I'm kinda confused right now on how to get "902". Please help.
Thanks.
Manny Pacquiao once posted in his twitter:
It doesn't matter if the grammar is wrong, what matter is that you get the message
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|