fsPromises.utimes(path, atime, mtime)
path
<string> | <Buffer> | <URL>atime
<number> | <string> | <Date>mtime
<number> | <string> | <Date>- 返回: <Promise>
atime
和 mtime
参数遵循以下规则:
- 值可以是代表 Unix 纪元时间的数字、
Date
、或数字字符串(例如'123456789.0'
)。 - 如果该值不能转换为数字,或者是
NaN
,Infinity
或-Infinity
,则将抛出Error
。
path
<string> | <Buffer> | <URL>atime
<number> | <string> | <Date>mtime
<number> | <string> | <Date>- Returns: <Promise>
Change the file system timestamps of the object referenced by path
then
resolves the Promise
with no arguments upon success.
The atime
and mtime
arguments follow these rules:
- Values can be either numbers representing Unix epoch time,
Date
s, or a numeric string like'123456789.0'
. - If the value can not be converted to a number, or is
NaN
,Infinity
or-Infinity
, anError
will be thrown.