944,153 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 371
  • C++ RSS
Oct 15th, 2009
0

Convert minutes to time

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 1
Posting Whiz in Training
Lukezzz is offline Offline
268 posts
since Mar 2008
Oct 15th, 2009
0
Re: Convert minutes to time
It doesn't have an inbuilt function (but I am sure they are in libraries)
BUT surely it is this
c++ Syntax (Toggle Plain Text)
  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.)
Reputation Points: 749
Solved Threads: 135
Practically a Master Poster
StuXYZ is offline Offline
660 posts
since Nov 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Can't get started: "no such file"...
Next Thread in C++ Forum Timeline: How To Capitalize ALL Letters using Toupper function





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC