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: incorrect handling of numeric times from before the unix epoch #64597
Linux johnp-pc 7.1.3-200.fc44.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Jul 4 19:20:12 UTC 2026 x86_64 GNU/Linux
Subsystem
node:fs
What steps will reproduce the bug?
Description
Since 1f842c2, NodeJS internally modifies numeric negative utimes to the current time. This is unexpected, as negative strings ("-1") work as expected. This issue was previously reported, but not all possible types (date, string, number) were considered. and the bug therefore wrongly closed.
Reproducer
importfsfrom'node:fs';constfile='neg_timespec.txt';fs.writeFileSync(file,'test');// Set time to -1 second before 1970fs.utimesSync(file,-1,-1);conststats=fs.statSync(file);console.log("Expected mtime (ms): -1000");console.log("Actual mtime (ms): ",stats.mtime.getTime());fs.unlinkSync(file);
changed the title [-]fs: incorrect handling numeric times from before the unix epoch[/-][+]fs: incorrect handling of numeric times from before the unix epoch[/+]on Jul 19, 2026
This issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
Activity
[-]fs: incorrect handling numeric times from before the unix epoch[/-][+]fs: incorrect handling of numeric times from before the unix epoch[/+]github-actions commentedon Oct 18, 2026
This issue has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.