[英]Java api to access Linux nanos since epoch
Linux time man page specifies that the clock time structure contains nanoseconds since epoch. Linux 时间手册页指定时钟时间结构包含自纪元以来的纳秒。 Is this exposed in Java in any api ?这是在 Java 中的任何 api 中公开的吗? In other words , why is there no JDK api like System.currentNanos() that returns nanos since Epoch ?换句话说,为什么自 Epoch 以来没有像 System.currentNanos() 这样返回 nanos 的 JDK api?
Note : I know System.nanoTime() returns nanos , but its NOT with reference to Epoch time , and cannot be used across VMs for time comparison.注意:我知道 System.nanoTime() 返回 nanos ,但它不是参考 Epoch time ,并且不能跨虚拟机使用以进行时间比较。
Edit : I am not asking how to format a date value - I am asking how to query the system for nanotime SINCE epoch ?编辑:我不是问如何格式化日期值 - 我问的是如何查询系统的纳米时间 SINCE 纪元?
因为 Java 旨在在各种设备上工作,所以它与任何一个这样的平台都没有那么紧密的联系。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.