Convert minutes to time

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2008
Posts: 173
Reputation: Lukezzz is an unknown quantity at this point 
Solved Threads: 1
Lukezzz Lukezzz is offline Offline
Junior Poster

Convert minutes to time

 
0
  #1
Oct 15th, 2009
Hi,

I wonder if C++ has any inbuilt function where you can convert Minutes to time like this example:

70 minutes in time would be: 01:10
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 397
Reputation: StuXYZ is a glorious beacon of light StuXYZ is a glorious beacon of light StuXYZ is a glorious beacon of light StuXYZ is a glorious beacon of light StuXYZ is a glorious beacon of light StuXYZ is a glorious beacon of light 
Solved Threads: 72
StuXYZ StuXYZ is offline Offline
Posting Whiz
 
0
  #2
Oct 15th, 2009
It doesn't have an inbuilt function (but I am sure they are in libraries)
BUT surely it is this
  1. int totalMin=890;
  2. int min=total % 60 ;
  3. int hour = (total / 60) % 24;
  4. // etc

not exactly difficult to put into a function.
(A fraction of care is needed if using double values but the same principle.)
experience is the most expensive way to learn anything
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC