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
廣告
© . All rights reserved.