You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fs.utimes doesn't support number or string on Windows #33227
changed the title [-]`fs.utimes` doesn't support `number` on Windows[/-][+]`fs.utimes` doesn't support `number` or `string` on Windows[/+]on May 4, 2020
Activity
[-]`fs.utimes` doesn't support `number` on Windows[/-][+]`fs.utimes` doesn't support `number` or `string` on Windows[/+]bnoordhuis commentedon May 4, 2020
No, but you're passing numbers that are probably out of range for the underlying file system.
Date.now()returns the time in milliseconds butfs.utimesSync()takes timestamps in seconds. You need to divide by 1,000.SimenB commentedon May 4, 2020
Oh! Hah, would you look at that 😅 That's not mentioned in the docs, although I guess most people calling these APIs know that already?
Would it be possible for
utimesto throw if number passed in is way into the future? Might be valid tho.bnoordhuis commentedon May 4, 2020
The documentation could be clearer on the units used, I agree. Do you want to send a PR for that?
I don't think so. There's no real way to know what the supported range is until you try it.
SimenB commentedon May 4, 2020
@bnoordhuis quick try (or as quick as GitHub's laggy web editor allows) here: #33230
SimenB commentedon May 8, 2020
Closed by above PR
fix: - [`fs.utimes` doesn't support `number` or `string` on Windows ·…