PhantomJS - lastModified



此方法返回对给定文件执行的最后修改的详细信息。它返回文件的最后修改日期和时间。

语法

语法如下 -

var fs = require('fs'); 
fs.lastModified(filename); 

示例

var fs = require('fs'); 
var system = require('system'); 
console.log(fs.lastModified(system.args[1])); 
phantom.exit();

上述程序生成以下输出

Sat May 13 2017 15:18:59 GMT+0530 (India Standard Time)
phantomjs_file_system_module_methods.htm
广告