c - 如何消除与大纪元时间的时间差异?

标签 c time epoch

我试图从文件的 inode 找出文件的创建时间。我已经使用 gmtime() 转换为正常时间。但与 ls -l 命令显示的时间相差 6 小时 30 分钟。

为什么会这样呢?如何消除这种差异?

最佳答案

来自ma​​n 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/

相关文章:

Java - SimpleDateFormat 格式化程序以毫秒为单位返回纪元时间

c - 无法获得简单的 C 代码完成以在多个 IDE 上的 Linux 中工作

c - Linux 文件中的魔数(Magic Number)。 C语言编程

c - 堆栈中使用的 C 中的空指针

parsing - 如何将时间设置为 dd-MMM-yyyy HH :mm:ss in go?

java - 如何在Java中使用Unix纪元每分钟打印数据

c - 二叉树前序遍历只打印 NULL

php - 使用 PHP 将时间增加 30 秒

python - 从日期时间获取 SQLite 中的平均时间

Excel posix时间