0

I want to convert Minutes as "Hours:Minutes:Seconds".

How can this achieved using c#.

I have tried this

driveHours = (totalHours.balanceDriveMinutes / 60).ToString("00") + " Hrs. "
 + (totalHours.balanceDriveMinutes % 60 ).ToString("00") + " Min." + 
(totalHours.balanceDriveMinutes /3600).ToString("00") + " Sec."; 

But it doesn't seem to be correct.

Kjartan
  • 18,591
  • 15
  • 71
  • 96
vivek v
  • 167
  • 1
  • 3
  • 16

1 Answers1

7

try this

driveHours = TimeSpan.FromMinutes(totalHours.balanceDriveMinutes).ToString(@"hh\:mm\:ss");