public string ShowDateTime(string strSecond)
        {
            string strDate = string.Empty;
           
            if (strSecond != string.Empty)
            {
                if (strSecond == "0")
                {
                    return "在线用户,还没有退出.";
                }
                Int64 intSecond = Convert.ToInt64(strSecond);


                // if(intSecond > 86400)
                strDate = DateFormat(intSecond / 86400) + "天" + DateFormat((intSecond % 86400) / 3600) + "小时" + DateFormat((intSecond % 86400) % 3600 / 60) + "分钟" + DateFormat((intSecond % 86400) % 3600 % 60 % 60) + "秒";


            }
            return strDate;
        }

 

 private string DateFormat(long intNum)
        {
            string str;
            if (intNum > 9)
                str = intNum.ToString();
            else
                str = "0" + intNum.ToString();
            return str;
            //HttpUtility.UrlEncode(
        }

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2022-03-03
  • 2021-12-26
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案