gpt4 book ai didi

c - 如何将 C 中的 unix 时间戳作为 int 获取?

转载 作者:太空狗 更新时间:2023-10-29 16:19:23 25 4
gpt4 key购买 nike

我想获取当前时间戳并使用 fprintf 将其打印出来。

最佳答案

对于 32 位系统:

fprintf(stdout, "%u\n", (unsigned)time(NULL)); 

对于 64 位系统:

fprintf(stdout, "%lu\n", (unsigned long)time(NULL)); 

关于c - 如何将 C 中的 unix 时间戳作为 int 获取?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11765301/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com