在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
#region 秒转换小时 SecondToHour /// <summary> /// 秒转换小时 /// </summary> /// <param name="time"></param> /// <returns></returns> public static string SecondToHour(double time) { string str = ""; int hour = 0; int minute = 0; int second = 0; second = Convert.ToInt32(time); if (second > 60) { minute = second / 60; second = second % 60; } if (minute > 60) { hour = minute / 60; minute = minute % 60; } return (hour + "小时" + minute + "分钟" + second + "秒"); } #endregion 比如:一个小时=60分=3600秒 调用:SecondToHour(3600); 显示:
可以再进行优化,如果分钟和秒为0时,就不显示。 http://blog.csdn.net/lilinoscar/article/details/51968565 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论