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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Time in Minutes to a Time string

Status
Not open for further replies.

SPrelewicz

Programmer
Jul 16, 2001
124
US
Does anyone know of any existing function available, or offer advice on how to implement the following:

Given the time in minutes, how can I convert it onto a time string?

Example:

480 converts to 8:00 AM. 510 converts to 8:30. 525 converts to 8:45. 0 converts to 12:00 AM. This seems simple enough, and I could implement it with a long function accounting for all cases by dividing by 60, but I'm hoping someone knows of saomething existing or can offer an efficient solution.
 
Nevermind, found an adequate solution. Using timeInMinutes%60 gives the minutes needed, duh.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top