统计时间值
¥Stat time values
atimeMs
、mtimeMs
、ctimeMs
、birthtimeMs
属性是数值,以毫秒为单位保存相应的时间。它们的精度是特定于平台的。当 bigint: true
被传递到生成对象的方法中时,属性将是 bigints,否则它们将是 numbers。
¥The atimeMs
, mtimeMs
, ctimeMs
, birthtimeMs
properties are
numeric values that hold the corresponding times in milliseconds. Their
precision is platform specific. When bigint: true
is passed into the
method that generates the object, the properties will be bigints,
otherwise they will be numbers.
atimeNs
、mtimeNs
、ctimeNs
、birthtimeNs
属性是 bigints,以纳秒为单位保存相应的时间。它们仅在 bigint: true
传入到生成对象的方法中时出现。它们的精度是特定于平台的。
¥The atimeNs
, mtimeNs
, ctimeNs
, birthtimeNs
properties are
bigints that hold the corresponding times in nanoseconds. They are
only present when bigint: true
is passed into the method that generates
the object. Their precision is platform specific.
atime
、mtime
、ctime
和 birthtime
是不同时间的 Date
对象替代表示。Date
和数字值是不关联的。分配新的数值或改变 Date
值不会反映在相应的替代表示中。
¥atime
, mtime
, ctime
, and birthtime
are
Date
object alternate representations of the various times. The
Date
and number values are not connected. Assigning a new number value, or
mutating the Date
value, will not be reflected in the corresponding alternate
representation.
统计对象中的时间具有以下语义:
¥The times in the stat object have the following semantics:
-
atime
"访问时间":上次访问文件数据的时间。由mknod(2)
、utimes(2) 和read(2)
系统调用更改。¥
atime
"Access Time": Time when file data last accessed. Changed by themknod(2)
,utimes(2)
, andread(2)
system calls. -
mtime
"修改时间":上次修改文件数据的时间。由mknod(2)
、utimes(2) 和write(2)
系统调用更改。¥
mtime
"Modified Time": Time when file data last modified. Changed by themknod(2)
,utimes(2)
, andwrite(2)
system calls. -
ctime
"更改时间":上次更改文件状态的时间(inode 数据修改)。由chmod(2)
、chown(2)、link(2)、mknod(2)、rename(2)、unlink(2)、utimes(2)、read(2) 和write(2)
系统调用更改 。¥
ctime
"Change Time": Time when file status was last changed (inode data modification). Changed by thechmod(2)
,chown(2)
,link(2)
,mknod(2)
,rename(2)
,unlink(2)
,utimes(2)
,read(2)
, andwrite(2)
system calls. -
birthtime
"出生时间":文件创建时间。创建文件时设置一次。在出生时间不可用的文件系统上,该字段可能会保存ctime
或1970-01-01T00:00Z
(即 Unix 纪元时间戳0
)。在这种情况下,该值可能大于atime
或mtime
。在 Darwin 和其他 FreeBSD 变体上,如果使用utimes(2)
系统调用将atime
显式设置为比当前birthtime
更早的值,则还要进行设置。¥
birthtime
"Birth Time": Time of file creation. Set once when the file is created. On filesystems where birthtime is not available, this field may instead hold either thectime
or1970-01-01T00:00Z
(ie, Unix epoch timestamp0
). This value may be greater thanatime
ormtime
in this case. On Darwin and other FreeBSD variants, also set if theatime
is explicitly set to an earlier value than the currentbirthtime
using theutimes(2)
system call.
在 Node.js 0.12 之前,ctime
是 Windows 系统上的 birthtime
。从 0.12 开始,ctime
不是 "创建时间",在 Unix 系统上,它从来不是。
¥Prior to Node.js 0.12, the ctime
held the birthtime
on Windows systems. As
of 0.12, ctime
is not "creation time", and on Unix systems, it never was.