Android java.util.concurrent.TimeUnit 将毫秒转换为分钟 [英] Android java.util.concurrent.TimeUnit Convert Milliseconds to Minutes

查看:32
本文介绍了Android java.util.concurrent.TimeUnit 将毫秒转换为分钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用 java.util.concurrent.TimeUnit 将毫秒转换为分钟?

这个答案 似乎建议您可以使用 TimeUnit.MILLISECONDS.toMinutes() 方法,并且文档建议您可以使用 TimeUnit.MILLISECONDS.convert()使用 TimeUnit.MINUTES 的方法 - 问题是 TimeUnit.MINUTESTimeUnit.MILLISECONDS.toMinutes() 似乎都不存在.>

我在这里遗漏了什么吗?

解决方案

我相信 TimeUnit 可能在 1.6 中增加了分钟:1.6 文档1.5 文档

Is there a way to convert milliseconds to minutes using java.util.concurrent.TimeUnit?

This answer seems to suggest that you can use a TimeUnit.MILLISECONDS.toMinutes() method, and the documentation suggests that you could use the TimeUnit.MILLISECONDS.convert() method with TimeUnit.MINUTES - the problem is that neither TimeUnit.MINUTES or TimeUnit.MILLISECONDS.toMinutes() seem to actually exist.

Am I missing something here?

解决方案

I believe TimeUnit might have added minutes in 1.6: 1.6 docs, 1.5 docs

这篇关于Android java.util.concurrent.TimeUnit 将毫秒转换为分钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆