doc: improve fs.utimes

PR-URL: https://github.com/nodejs/node/pull/14154
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Refael Ackermann 2017-07-10 10:53:50 -04:00 committed by Ruben Bridgewater
parent a636b72645
commit 64e97b2c26
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -1323,13 +1323,13 @@ changes:
--> -->
* `fd` {integer} * `fd` {integer}
* `atime` {integer} * `atime` {number|string|Date}
* `mtime` {integer} * `mtime` {number|string|Date}
* `callback` {Function} * `callback` {Function}
* `err` {Error} * `err` {Error}
Change the file timestamps of a file referenced by the supplied file Change the file system timestamps of the object referenced by the supplied file
descriptor. descriptor. See [`fs.utimes()`][].
*Note*: This function does not work on AIX versions before 7.1, it will return *Note*: This function does not work on AIX versions before 7.1, it will return
the error `UV_ENOSYS`. the error `UV_ENOSYS`.
@ -2354,21 +2354,18 @@ changes:
--> -->
* `path` {string|Buffer|URL} * `path` {string|Buffer|URL}
* `atime` {integer} * `atime` {number|string|Date}
* `mtime` {integer} * `mtime` {number|string|Date}
* `callback` {Function} * `callback` {Function}
* `err` {Error} * `err` {Error}
Change file timestamps of the file referenced by the supplied path. Change the file system timestamps of the object referenced by `path`.
*Note*: The arguments `atime` and `mtime` of the following related functions The `atime` and `mtime` arguments follow these rules:
follow these rules: - Values can be either numbers representing Unix epoch time, `Date`s, or a
numeric string like `'123456789.0'`.
- The value should be a Unix timestamp in seconds. For example, `Date.now()` - If the value can not be converted to a number, or is `NaN`, `Infinity` or
returns milliseconds, so it should be divided by 1000 before passing it in. `-Infinity`, a `Error` will be thrown.
- If the value is a numeric string like `'123456789'`, the value will get
converted to the corresponding number.
- If the value is `NaN`, `Infinity` or `-Infinity`, an Error will be thrown.
## fs.utimesSync(path, atime, mtime) ## fs.utimesSync(path, atime, mtime)
<!-- YAML <!-- YAML