com.google.protobuf.Timestamp与时间Date的转换

来源:互联网 发布:fast迅捷网络fwr200 编辑:程序博客网 时间:2024/04/30 02:29

Date转换为com.google.protobuf.Timestamp:

Timestamp a = Timestamps.fromMillis(new Date().getTime());
com.google.protobuf.Timestamp转化为Date:
Timestamp timestamp = null;
Date date = new Date(timestamp.getSeconds() * MILLIS_PER_SECOND);

阅读全文
0 0