aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRefael Ackermann <refack@gmail.com>2017-07-10 10:53:50 -0400
committerRuben Bridgewater <ruben@bridgewater.de>2017-09-28 02:16:22 -0300
commit64e97b2c26f2ccd13bcb420b36f1285d4720845e (patch)
tree1d5c1af55e43f240bfd479bc5fa2ef0047c41ffe /doc
parenta636b7264561b3e64cb34e76cf5c72b446ae9e10 (diff)
downloadandroid-node-v8-64e97b2c26f2ccd13bcb420b36f1285d4720845e.tar.gz
android-node-v8-64e97b2c26f2ccd13bcb420b36f1285d4720845e.tar.bz2
android-node-v8-64e97b2c26f2ccd13bcb420b36f1285d4720845e.zip
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>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/fs.md27
1 files changed, 12 insertions, 15 deletions
diff --git a/doc/api/fs.md b/doc/api/fs.md
index e322728a01..b6dd70f57f 100644
--- a/doc/api/fs.md
+++ b/doc/api/fs.md
@@ -1323,13 +1323,13 @@ changes:
-->
* `fd` {integer}
-* `atime` {integer}
-* `mtime` {integer}
+* `atime` {number|string|Date}
+* `mtime` {number|string|Date}
* `callback` {Function}
* `err` {Error}
-Change the file timestamps of a file referenced by the supplied file
-descriptor.
+Change the file system timestamps of the object referenced by the supplied file
+descriptor. See [`fs.utimes()`][].
*Note*: This function does not work on AIX versions before 7.1, it will return
the error `UV_ENOSYS`.
@@ -2354,21 +2354,18 @@ changes:
-->
* `path` {string|Buffer|URL}
-* `atime` {integer}
-* `mtime` {integer}
+* `atime` {number|string|Date}
+* `mtime` {number|string|Date}
* `callback` {Function}
* `err` {Error}
-Change file timestamps of the file referenced by the supplied path.
-
-*Note*: The arguments `atime` and `mtime` of the following related functions
-follow these rules:
+Change the file system timestamps of the object referenced by `path`.
-- The value should be a Unix timestamp in seconds. For example, `Date.now()`
- returns milliseconds, so it should be divided by 1000 before passing it in.
-- 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.
+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`, a `Error` will be thrown.
## fs.utimesSync(path, atime, mtime)
<!-- YAML