本文实例讲述了C#实现毫秒转换成时分秒的方法。分享给大家供大家参考。具体实现方法如下:
public static String formatLongToTimeStr(Long l) { String str = ""; int hour = 0; int minute = 0; int second = 0; second = l.intValue() / 1000; if (second > 60) { minute = second / 60; second = second % 60; } if (minute > 60) { hour = minute / 60; minute = minute % 60; } return (hour.toString() + "小时" + minute.toString() + "分钟" + second.toString() + "秒");}
希望本文所述对大家的C#程序设计有所帮助。
新闻热点
疑难解答