把秒数转换为%d:%02d:%02d 格式
private String stringForTime(int timeSec) {
int totalSeconds = timeSec;
int seconds = totalSeconds % 60;
int minutes = totalSeconds / 60 % 60;
int hours = totalSeconds / 3600;
if (null!=mFormatBuilder){
this.mFormatBuilder.setLength(0);
}
return hours > 0 ? this.mFormatter.format("%d:%02d:%02d", new Object[]{Integer.valueOf(hours), Integer.valueOf(minutes), Integer.valueOf(seconds)}).toString() : this.mFormatter.format("%02d:%02d", new Object[]{Integer.valueOf(minutes), Integer.valueOf(seconds)}).toString();
}

java时间格式转化(毫秒 to 00:00)的更多相关文章

  1. Sql server 时间格式转化

    --.SQL时间格式转化 --日期转换参数 ) --2009-03-15 15:10:02 ),'-',''),' ',''),':','') ) , ) --2009/03/15 ) , ) ) , ...

  2. 29-jsp中用js进行时间格式转化

    CST可以为如下4个不同的时区的缩写: 美国中部时间:Central Standard Time (USA) UT-6:00 澳大利亚中部时间:Central Standard Time (Austr ...

  3. python:时间格式转化

    1.获取秒级时间戳与毫秒级时间戳.微秒级时间戳 import time import datetime t = time.time() print (t) #原始时间数据 print (int(t)) ...

  4. java时间格式转换任意格式

    例如:20180918/120023转换成2018-09-18 12:00:23 //时间格式转换 public String getNomalTime(String oldTime){ String ...

  5. Java时间格式字符串与Date的相互转化

    目录 将Date转化为格式化字符串 时间格式字符串转化为Date @ 将Date转化为格式化字符串 将Date转化为格式化字符串是利用SimpleDateFormat类继承自 java.text.Da ...

  6. JAVA时间格式转换大全

    import java.text.*; import java.util.Calendar; public class VeDate { /** * 获取现在时间 * * @return 返回时间类型 ...

  7. 时间格式转化 String2datestyle

    时间格式转化成string工具类: package cn.javass.util; import java.text.DateFormat; import java.text.SimpleDateFo ...

  8. java时间格式大全

    java.util.*;import java.text.*;import java.util.Calendar; public class VeDate { /**  * 获取现在时间  *   * ...

  9. Java时间格式转换工具类

    把当前时间修改成指定时间 //把当前时间修改成指定时间 public String dateUtil(Integer seconds, String dateFormatPattern){ Date ...

随机推荐

  1. jsp分页

    <%!    int pataSize=5;// 每页多少数据    int totalCount =0; //数据共多少    int pageCount = 0; ///数据共有多少页    ...

  2. 5.For loops

    for 循环语句   在需要重复执行代码的时候,for循环常常被用到.我们可以让一行代码执行10次:   for i in range(1,11): print(i)   最后一个数字11是不包含在内 ...

  3. iOS 横竖屏适配 笔记

    研究消息转发机制 已经一周多了,但是 还是没整理出博客, 还是先写一个 项目中遇到的 横竖屏适配问题. // 开启自动转屏 - (BOOL)shouldAutorotate { return YES; ...

  4. Jenkins-Dingding Notification Plugin 配置

    具体内容请移步Jenkins官网或作者Github,本文仅为实践分享,记录几个小坑! 感谢插件作者的贡献! 转载注明出处:http://www.cnblogs.com/ityoung/p/648915 ...

  5. ORA-28002 -- oracle密码过期

    1.登录oracle 2.查看密码有效期时长 SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PAS ...

  6. 新安装的soapui启动时报错及解决方法

    今天新安装了soapui准备测试一下接口,结果安装成功后启动时报错:The JVM could not be started. The maximum heap size (-Xmx) might b ...

  7. 52e174ef38c96afbbeabe55d2ec53622 我知道这是什么

    52e174ef38c96afbbeabe55d2ec53622   我知道这是什么52e174ef38c96afbbeabe55d2ec53622   我知道这是什么52e174ef38c96afb ...

  8. BZOJ:4031: [HEOI2015]小Z的房间

    Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 1103  Solved: 536[Submit][Status][Discuss] Descripti ...

  9. C/C++中substr函数的应用(简单讲解)

    substr(字符串,截取开始位置,截取长度) //返回截取的字 substr('Hello World',0,1) //返回结果为 'H'  *从字符串第一个字符开始截取长度为1的字符串 subst ...

  10. NEFU_117素数个数的位数

    题目传送门:点击打开链接 Problem : 117 Time Limit : 1000ms Memory Limit : 65536K description 小明是一个聪明的孩子,对数论有着很浓烈 ...