// 假設時間長度為 iVideolen 秒
int iSecond = iVideolen % 60 ;
int iMinute = (iVideolen/60) % 60;
int iHour = (iVideolen/3600) % 24;
String sVideoLen = "";
if(iHour>0)
// 顯示 時:分:秒
sVideoLen = String.format("%d", iHour) + ":" + String.format("%02d", iMinute) + ":" + String.format("%02d", iSecond);
else
if(iMinute>0)
// 顯示 分:秒
sVideoLen = String.format("%d", iMinute) + ":" + String.format("%02d", iSecond);
else
// 顯示 秒
sVideoLen = String.format("%d", iSecond);
沒有留言:
張貼留言