Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help me with this function

Status
Not open for further replies.

piry25

Technical User
May 22, 2000
2
0
0
US
I have a little&nbsp;&nbsp;project that the input will read in a quantity of minutes and seconds from the user, and then convert this amount of time to number of years, days, hours, minutes, and seconds.&nbsp;&nbsp;I am stuck in the function part please help!!!!!!!!!!!<br><br>Piry
 
first, predetermine the # of minutes in a year, day, hour, minute, (Seconds would be silly)<br><br><br>#define MINS_IN_MIN 1<br>#define MINS_IN_HOUR 60<br>#define MINS_IN_DAY 1440<br>etc...<br><br>Then compare your input in minutes with MINS_IN_YEAR and if greater, divide by MINS_IN_YEAR. The resulting quoient will be the number of years. Take the remainder and compare with MINS_IN_DAY and if greater, divide by MINS_IN_DAY. The resulting quoient will be the number of days.<br>And so on....<br>The seconds (Assuming there are less than 60) will just be passed to the output.<br><br> <p> <br><a href=mailto:Kim_Christensen@telus.net>Kim_Christensen@telus.net</a><br><a href= Page</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top