Replies: 1 comment
-
time_t time = buf->readInt32();
Timestamp ts = Timestamp::fromUnixTime(time);
LOG_INFO << time << ", " << ts.toFormattedString();
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
类Timestamp的构造函数的形参为int64_t,
Timestamp::kMicroSecondsPerSecond类型为const int,
如果使用一个整型变量乘以Timestamp::kMicroSecondsPerSecond用以构造Timestamp时会导致整型溢出。
如TimeClient的例子:
Beta Was this translation helpful? Give feedback.
All reactions