Closed
Description
Version: v6.10.3
Platform: Windows 10 64-bit
Subsystem: fs
Disk format: NTFS
This issue is related to #13255 .
let fs = require('fs');
let src = 'path/to/src';
let src_stats = fs.statSync(src);
let dest = 'path/to/dest'
if (fs.existsSync(dest)) {
fs.utimesSync(dest, src_stats.atime, src_stats.mtime);
}
let dest_stats = fs.statSync(dest);
console.log(src_stats.mtime);
console.log(dest_stats.mtime);
console.log(src_stats.mtime == dest_stats.mtime);
output:
2017-05-11T06:35:33.501Z
2017-05-11T06:35:33.000Z
false
So the millisecond part of mtime
is discarded when setting the time but not when getting the time.
Why is this inconsistent?