At the validation I believe that the seconds should until 59. For the hours you 23, 59. Why not the same for seconds.
For the extract when you multiply and then do a mod, you will get 0.
123 * 100 = 12300
12300 mod 100 = 0
12300/100 = 123
mod returns what is left from the division:
9 = 2 * 4 + 1
9 mod 2 = 1
9 mod 4 = 1
This is the time: 125345 (12:53:45)
In java when you divide an int with an int you will get an int:
125345/100 = 1253
1253 * 100 = 125300
125345/100.0 = 1253.45
So when you divide by 100 you have:
1253
The time is:
125345
1253
Think how can you get the seconds.
THEN:
1253 / 100 =
12
Now how can you get the minutes.
The 12 is the hours
Last edited by javaAddict; Nov 3rd, 2009 at 7:03 am.
Reputation Points: 1014
Solved Threads: 446
Nearly a Senior Poster
Offline 3,260 posts
since Dec 2007