Dividing seconds by 3,600 gives you hours because there are 3,600 seconds in every hour (60 minutes × 60 seconds). If the result has a decimal, the whole number part is the hours and the remainder represents the extra minutes and seconds. For example, 5,400 ÷ 3,600 = 1.5 hours, which is 1 hour and 30 minutes.
This is a common operation when computing differences between Unix timestamps (which are in seconds since January 1, 1970). Subtract one timestamp from another and you get seconds elapsed — divide by 3,600 and you get hours elapsed.
Leave a Comment
We'd love to hear from you