Home >Web Front-end >JS Tutorial >Instructions for using the fs.utimesSync method in node.js_node.js
Method description:
Synchronized version of utimes(), which modifies file timestamps synchronously.
Grammar:
Since this method belongs to the fs module, the fs module needs to be introduced before use (var fs= require(“fs”) )
Receive parameters:
path File path
mtime Modification time, indicating the time and date when the file was modified. When the content of the file changes, the modification date of the file will be updated
atime access time, indicating the time and date when the file was last accessed. Every time an application or service uses a system call to read a file, the file's access time is updated.
Example:
Source code: