c# 将秒数转换成时,分,秒的方法

 TimeSpan ts = new TimeSpan(0, 0,Convert.ToInt32( duration));
                  string str = "";
                  if (ts.Hours > 0)
                  {
                      str =  ts.Hours.ToString() + "小时 "+ts.Minutes.ToString()+"分钟 "+ts.Seconds+"";
                  }
                  if (ts.Hours == 0&&ts.Minutes>0)
                  {
                      str =  ts.Minutes.ToString() + "分钟 " + ts.Seconds + "";
                  }
                  if (ts.Hours == 0&&ts.Minutes==0)
                  {
                      str =  ts.Seconds + "";
                  }
                  return str;

http://blog.csdn.net/zghnpdswyp/article/details/50463898

原文地址:https://www.cnblogs.com/fuqiang88/p/6638700.html