码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2018-08-02 16:08:55      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:ret   time   style   double   获取   string   color   int   public   

 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));
    }

 

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

标签:ret   time   style   double   获取   string   color   int   public   

原文地址:https://www.cnblogs.com/huanghuanghui/p/9407221.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!