views:

116

answers:

1

How to convert betwee number of minutes to hh:mm format in obj-c? For example, 65 minutes = 01:05 ?

+8  A: 

If you literally want to format minutes as hh:mm, then this is a trivial math + string formatting problem.

An inline conversion would look like:

[NSString stringWithFormat: @"%02d:%02d", minutes / 60, minutes % 60]

Jim Correia