首页 Node.js核心模块手册

参数说明


utimesSync(path, atime, mtime)
path          文件路径
atime         访问时间
mtime         修改时间

示例


var fs = require("fs");
try{
  fs.utimesSync("./liboke/test.txt", new Date(), new Date());
  console.log("成功");
}catch(e){
  console.log("失败");
}