public static string Sec2hms(int seconds)
{
TimeSpan t = TimeSpan.FromSeconds(seconds);
StringBuilder SB = new StringBuilder();
char[] trim = new char[] { ',', ' ' };
int Hours = t.Hours;
// If we have more then 24 hours, then we need to
// convert the days to hours
if (t.Days > 0)
Hours += t.Days * 24;
// Format
if (Hours > 0)
SB.AppendFormat("{0} Hours, ", Hours);
if (t.Minutes > 0)
SB.AppendFormat("{0} Minutes, ", t.Minutes);
if (t.Seconds > 0)
SB.AppendFormat("{0} Seconds, ", t.Seconds);
return SB.ToString().TrimEnd(trim);
}