Converting Time Difference to Minutes: A Problem for Idiots

  • Thread starter Thread starter King
  • Start date Start date
  • Tags Tags
    Difference Time
Click For Summary
SUMMARY

The discussion focuses on converting time differences into minutes using a 24-hour clock format. The user initially attempted to convert the difference between two times, 900 and 1500, by dividing by 100, which is unnecessary. The correct method involves calculating the hour difference and converting it to minutes by multiplying by 60. The conversation emphasizes that while programming may complicate time calculations, understanding the basic principles of time conversion is essential.

PREREQUISITES
  • Understanding of 24-hour clock format
  • Basic arithmetic operations (addition, subtraction, multiplication)
  • Familiarity with time conversion principles
  • Basic programming concepts related to time handling
NEXT STEPS
  • Learn about time manipulation in programming languages like Python or JavaScript
  • Explore libraries for date and time handling, such as Moment.js or Python's datetime module
  • Research best practices for time zone conversions in software applications
  • Study the differences between 12-hour and 24-hour time formats in programming
USEFUL FOR

This discussion is beneficial for software developers, programmers dealing with time calculations, and anyone interested in improving their understanding of time conversion methods in coding.

King
Messages
43
Reaction score
0
Hey all,

I have a quick question about converting a difference between 2 times into minutes.
I am modelling a 24 hour clock. The time 900 represents the time 09:00 and 1500 represents the time 15:00. If I subtract the two I get a difference of 600. If I want to convert this to minutes I would write (600/100)*60. There's my answer, but I can't seem to get my head round what (600/100) is doing. Why do I need to divide it by 100?

This question was brought to you by an idiot.
 
Mathematics news on Phys.org
Because you represent hours as "hours*100", so to get "hours" back you need to divide by 100.
 
12 and 24 hour clocks use the format: HH:MM, where H is an hour digit and M is a minute digit. Don't subtract the two times like that.
15:00 - 09:00 = 6:00
Six hours.
There's 60 minutes in an hour, so multiply this by 60 minutes per hour.

6 hour*\frac{60 minute}{1 hour} = 360 minutes

You don't need to divide by 100.

Let's say you were looking at the difference between 7:00 and 8:45. Since there's 60 minutes in an hour, you can look at it like this.

You need 60 minutes to reach 8:00 from 7:00. Then you need an additional 45 minutes to reach 8:45.

Look at the difference between 7:00 and 10:30 now.
You need 3 hours (10-7) and 30 minutes (30-0) to reach the end time. To get this into minutes, just multiply the 3 hours by 60 minutes per hour = (180 minutes), and add to 30 minutes to obtain 210 minutes.

Hope this helps. Remember, there are no stupid questions; only answers can be stupid.
 
Thanks a lot for the answers. Makes sense now :smile:

The reason I had to do it like that however is for computer programming. Unfortunately coding a program to understand HH:MM is more complicated than doing HHMM-HHMM, though the former is so much easier to do in our heads :-p
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
8
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
2
Views
2K
Replies
13
Views
1K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 20 ·
Replies
20
Views
2K