java - jdk中有没有提供纳秒转描述的方法?
PHP中文网
PHP中文网 2017-04-18 09:20:57
0
1
353

比如纳秒数37370571461,如果要转秒数,自己写方法的话,要依次跟1000取整,取余,才能将37370571461纳秒转换成37秒370毫秒571微妙461纳秒,有没有现成的jar包提供了这个方法的实现呢?不需要我再另外自己写方法呢?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
Ty80

There is a ready-made nanosecond to second conversion, but it is not in Chinese, and it cannot express the way of saying nanosecond + millisecond + microsecond. However, your situation is very special. I suggest you convert it directly by intercepting the string. The 3 digits of a certain digit are nanoseconds, the next 3 digits are microseconds, and so on. This is hassle-free and efficient at the same time.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!