秒转换成时分秒

private String returnFullTimes(int theSecond)
        {
            int h = 0, m = 0, s = 0;

            h = (int)Math.Floor(theSecond / 3600.0);
            if (h > 0)
            {
                m = (int)Math.Floor((theSecond - h * 3600.0) / 60);
                if (m > 0)
                {
                    s = theSecond - h * 3600 - m * 60;
                }
                else
                {
                    s = theSecond - h * 3600;       //原来这里写错了,写成了s   =   theSecond;   
                }
            }
            else
            {
                m = (int)Math.Floor(theSecond / 60.0);
                if (m > 0)
                {
                    s = theSecond - m * 60;
                }
                else
                {
                    s = theSecond;
                }
            }
            return h + "" + m + "" + s + "";
        }
原文地址:https://www.cnblogs.com/chengulv/p/5709697.html