Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个双倍的时代,需要传递给一个需要 time_t 的函数。如何将双倍的纪元转换为 time_t?我在使用 C++ 代码的 Linux 上。谢谢。
如果你有 epoch double,这不应该工作吗?
double
time_t t = static_cast<time_t>(epoch_time);
假设你的意思是时代是
自协调世界时间 1970 年 1 月 1 日 00:00:00 起经过的秒数。