Android java.util.concurrent.TimeUnit Convert Mill

2019-01-07 00:54发布

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?

标签: android time
2条回答
等我变得足够好
2楼-- · 2019-01-07 01:21

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

查看更多
我只想做你的唯一
3楼-- · 2019-01-07 01:30

All you need to do from ms to minutes is divide by 60000. Why not just do that>

查看更多
登录 后发表回答