«

Android中把时间戳转化为对应的时长

时间:2024-3-2 19:44     作者:韩俊     分类: Android


public static String GetStringFromLong(long timeLong)

{

long ss = timeLong / 1000;

long mm = ss / 60;

long hh = mm / 60;

String s;

String m;

String h;

if(ss % 60 < 10)

{

s = "0" + ss % 60;

}

else

{

s = ss % 60 +"";

}



if(mm % 60 < 10)

{

m = "0" + mm % 60;

}

else

{

m = mm % 60 +"";

}



if(hh % 60 < 10)

{

h = "0" + hh % 60;

}

else

{

h = hh % 60 +"";

}

return h + ":" + m + ":" + s;

}

        <p>版权声明:本文为博主原创文章,未经博主允许不得转载。</p>

标签: android

热门推荐