See code:
var fs = require('fs'); var file = "e:/myfile.txt"; fs.stat(file, function(err, stat1) { console.log(stat1.mtime); fs.stat(file, function(err, stat2) { console.log(stat2.mtime); console.log(stat1.mtime == stat2.mtime); console.log(stat1.mtime === stat2.mtime); }); });
And the result:
Sun, 20 May 2012 15:47:15 GMT Sun, 20 May 2012 15:47:15 GMT false false
I did not modify the file at runtime. But you cannot see ==
or ===
, they are not equal.
How to compare two mtime
in nodejs?
source share