-2

So I am getting output in #s and I need to convert this to hour:min form.

For example, 50 mins = 00:50 and 100 mins would be 01:40.

How do I accomplish this?

lbltime.Text = ??.ToString();
Loathing
  • 5,109
  • 3
  • 24
  • 35
D C
  • 15
  • 5

1 Answers1

0

For Example

if you means the 50 mins is a parameter int mins = 50;

then:

int mins = 50;
lbltime.Text =  (mins / 60).ToString().PadLeft(2,'0') + ":" + (mins - ((int)(mins / 60)) * 60).ToString().PadLeft(2, '0');
Fergus Liu
  • 39
  • 4