Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 635621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:25:28+00:00 2026-05-13T20:25:28+00:00

Someone does 20 Hours 42 Minutes & 16 Seconds in one shift totaling 74536

  • 0

Someone does 20 Hours 42 Minutes & 16 Seconds in one shift totaling 74536 seconds.
How do I get the hours from number of seconds the person has done for that shift?

20 * 60 * 60      =    72000
     42 * 60      =     2520
          16      =       16
                  +    -----
Total             =    74536
____________________________
Total % 60        =  Seconds (16)
Total % ?         =  Minutes (42)
Total % ?         =    Hours (20)

Tried 84600 already; turns out when a number is lower the modulus, it really is not very helpful, and something I am going to have to catch should someone only sign in for a few seconds …

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:25:28+00:00Added an answer on May 13, 2026 at 8:25 pm

    You need to use both modulus and division:

    t = seconds_in_shift;
    secs = t % 60;
    t /= 60;
    mins = t % 60;
    t /= 60;
    hour = t;
    

    Or:

    secs =  ttime % 60;
    mins = (ttime / 60) % 60;
    hour =  ttime / 3600;
    

    One other option uses the div() function from Standard C (<stdlib.h>):

    div_t v1 = div(ttime, 60);
    div_t v2 = div(v1.quot, 60);
    

    After that, v1.rem contains the seconds; v2.rem contains the minutes, and v2.quot contains the hours based on the number of seconds originally in ttime.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does someone knows how to calculate the total hours between 2 times? For example
Does someone know why i never get the first value of my array? it
does someone have an idea how to get the environment variables on Google-AppEngine ?
Few hours ago I changed from my old Debian box to a new one,
Does someone know a wrapper which would allow SQLite to load its data from
I've only been Googling for a couple hours or so, but if someone has
If someone does a full backup of their iPhone, to backup apps etc, and
Does someone know a simple way to set the default zoom and latitude/longitude with
Does someone knows why the mysql_real_escape_string() function adds three backslashes before quotes, or double
Does someone know how to find the longest common subsequence of a set of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.