我必须发送一条包含系统当前时间(EPOCH)的消息,该消息将根据以下详细信息发送。也以纳秒为单位发送 EPOCH 时间。
field - current_time
type - UINT64
byte size - 8
value - 0 to 1.84467E+19
我的消息结构如下,
class MsgHeader {
int message_length;
String sender_sys;
String destination_sys;
**int current_time;**
char message_type;
................
}
有人可以建议我如何使用 java 来做到这一点吗?
最佳答案
long current_time = System.currentTimeMillis() * 1000000L;
关于java - 如何在java中使用EPOCH时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15148990/