fs.utimes(path, atime, mtime, callback)


更改 path 指向的对象的文件系统时间戳。

atimemtime 参数遵循以下规则:

  • 值可以是表示 Unix 纪元时间的数字、 Date 对象、或类似 '123456789.0' 的数值字符串。
  • 如果该值无法转换为数值、或值为 NaNInfinity-Infinity,则抛出错误。

Change the file system timestamps of the object referenced by path.

The atime and mtime arguments follow these rules:

  • Values can be either numbers representing Unix epoch time, Dates, or a numeric string like '123456789.0'.
  • If the value can not be converted to a number, or is NaN, Infinity or -Infinity, an Error will be thrown.