Android中把00:00:00转换成毫秒值,代码怎么写 ,谢谢韩语发音

java时间格式转化(毫秒 to 00:00)-中国学网-中国IT综合门户网站-提供健康,养生,留学,移民,创业,汽车等信息
java时间格式转化(毫秒 to 00:00)
来源:互联网 更新时间: 12:12:39 责任编辑:鲁晓倩字体:
把秒数转换为%d:%02d:%02d 格式
private String stringForTime(int timeSec) {
int totalSeconds = timeS
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();}
相关文章:
<a href="/cse/search?q=<inputclass="s-btn"type="submit"text="<inputclass="s-btn"type="submit"text="<buttonhidefocusclass="s-btnjs-ask-btn"text="我要提问
<a href="/cse/search?q=SQL2005如何让datetime显示出微秒部分来自:
日分享至 :
我现在使用的是SQL Server 2005。由于开发的程序需要精确到微秒级,我能够把类似“ 10:19:17.783”的数据存储进数据库,但在数据库的表中显示出来的是“ 10:19:17”。在查询数据的时候,我使用“select * from table where time= 10:19:17.XXX”语句,如果微秒部分不相等,查询不到相对应的数据。我想知道如何在SQL Server 2005中将保存为datetime的数据的微秒部分在表中显示出来。若能把微秒部分显示出来,那我查询数据和查看数据都方便得多了。分享至 :
下一篇:上一篇:其它类似问题相关文章相关帖子--SQL2005如何让datetime显示出微秒部分public static String stringForTime(int timeMs, boolean isFull) {
&&&&&&& int totalSeconds = timeMs / 1000;
&&&&&&& int seconds = totalSeconds % 60;
&&&&&&& int minutes = (totalSeconds / 60) % 60;
&&&&&&& int hours = totalSeconds / 3600;
&&&&&&& mFormatBuilder.setLength(0);
&&&&&&& if (isFull) {
&&&&&&&&&&& return mFormatter.format(&%02d:%02d:%02d&, hours, minutes, seconds).toString();
&&&&&&& } else {
&&&&&&&&&&& if (hours & 0) {
&&&&&&&&&&&&&&& return mFormatter.format(&%d:%02d:%02d&, hours, minutes, seconds).toString();
&&&&&&&&&&& } else {
&&&&&&&&&&&&&&& return mFormatter.format(&%02d:%02d&, minutes, seconds).toString();
&&&&&&&&&&& }
&&& private String getTimeFormLong(long time) {
&&&&&&& if (time &= 0) {
&&&&&&&&&&& return &00:00&;
&&&&&&& int secondnd = (int) ((time / 1000) / 60);
&&&&&&& int million = (int) ((time / 1000) % 60);
&&&&&&& String f = secondnd &= 10 ? String.valueOf(secondnd) : &0& &#43; String.valueOf(secondnd);
&&&&&&& String m = million &= 10 ? String.valueOf(million) : &0& &#43; String.valueOf(million);
&&&&&&& return f &#43; &:& &#43;
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:12976次
排名:千里之外
转载:74篇
(1)(1)(2)(5)(8)(10)(1)(5)(8)(31)(10)}

我要回帖

更多关于 谢谢侬 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信