See Time-Stamping Usage.
Basically, if the web-server returns a Last-Modified
header for
wget
, then to set the local last-modified time to the origin's
date-time, use:
wget -S URL
This will work for both HTTP(S) and FTP.
As far as Firefox is concerned, this was discussed since 20 years ago and during many years in the post save original last-modified date on file downloads.
Finally, this was rejected and the following workaround was proposed:
- Install an older version of Firefox (specifically, Firefox 52.9.0 ESR, not a version higher!)
- Install an older version of DownThemAll (specifically, https://code.downthemall.net/releases/downthemall-3.0.7.xpi)
This combination is the last one that will preserve the last-modified time.
As regarding Chrome, this was also discussed in the long-running post Issue 4574: Feature request: preserve timestamps on downloaded files, but nothing ever came out of it.
Conclusion : Seems like wget is the only one, the browsers won't do it, by design.