Time in HH:MM:SS format form the second





5.00/5 (7 votes)
Following is code by which you get time in (HH:SS:MM) formate by passing second as argument public string getFormattedTimeFromSecond(double second) { TimeSpan t = TimeSpan.FromSeconds(second); string formatedTime = string.Format("{0:D2}H:{1:D2}M:{2:D2}S", ...
Following is code by which you get time in (HH:SS:MM) formate by passing second as argument
public string getFormattedTimeFromSecond(double second)
{
TimeSpan t = TimeSpan.FromSeconds(second);
string formatedTime = string.Format("{0:D2}H:{1:D2}M:{2:D2}S",
t.Hours,
t.Minutes,
t.Seconds);
return formatedTime;
}