我试图从文件的 inode 找出文件的创建时间。我已经使用 gmtime() 转换为正常时间。但与 ls -l 命令显示的时间相差 6 小时 30 分钟。
为什么会这样呢?如何消除这种差异?
最佳答案
来自man gmtime
The gmtime() function converts the calendar time timep to broken-down time representation, expressed in Coordinated Universal Time
(UTC).
...............
The localtime() function converts the calendar time timep to broken-time representation, expressed relative to the user's specified
timezone.
关于c - 如何消除与大纪元时间的时间差异?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12367492/