将从数据库获取的秒数转换为00:00:00格式

 public String timeChange(double time){
        int hour=(int)(time/3600);
        int minute=(int)(time%3600/60);
        int second=(int)(time%3600%60);
        return (hour>10?(""+hour):("0"+hour))+":"+(minute>10?(""+minute):("0"+minute))+":"+(second>10?(""+second):("0"+second));
    }

 

posted @ 2018-08-02 15:06  huanghaunghui  阅读(346)  评论(0编辑  收藏  举报