1. File time dependencies
The file time depends on Windows on:
- File system of storage media, i.e. NTFS, FAT32, exFAT, etc.
- Time zone, daylight saving time
- Automatic adjustment for daylight saving time
- Version of Windows
See Find out if file is older than 4 hours in batch file on Stack Overflow for a comprehensive description.
2. Kind of file times
The system drive with the Windows folder is by default using NTFS as file system.
There are three file times available on NTFS using the NTFS precision time.
- The last modification time which is the time the file contents was last modified. Archivers like 7-Zip, WinRAR or WinZIP store the last modification time of a file (or directory being in real also a file in file system with special attribute directory) on adding a file to an archive and restore the last modification time on extracting a file from an archive.
- The creation time which is the time a file was created in the current directory. This file time has nothing to do with file contents. It is the time a file was created in the current directory which means if a copy of a file is made, the copy gets a new creation time being the current time while the last modification time is not changed. So the copy has a newer creation time than the last modification time. The creation time is usually ignored by archives.
- The last access time which is the time the file was last accessed (opened) by a process. The update of last access time is disabled by default since Windows Vista for performance reasons via
HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisableLastAccessUpdate
with value 1
or since Windows 10 with hexadecimal value 0x80000003
(system managed, last access updates disabled). The last access time is usually ignored by archives.
The (original) ZIP file format supports only storing the last modification time with FAT timestamp (two seconds resolution).
The RAR 4 and RAR 5 file formats support storing all three times with FAT timestamp or NTFS precision time.
4. File time management by WinRAR
WinRAR gives a user the full control on which file times are stored in a RAR or ZIP archive (depending on archive file format) on adding a file to an archive and which file times are restored on files extracted from a RAR or ZIP archive file via the switch -ts
.
Click in WinRAR in last main menu Help on first menu item Help topics, select first tab Contents, expand list item Command line mode, expand sublist item Switches and click on list item "-ts[m,c,a,p][+,-,1]" - save or restore file time (modification, creation, access, preserve). The opened help page explains in full details the possibilities offered by WinRAR for archiving file times on adding files/directories to an archive and restoring file times on extracting files/directories from archives.
Files/directories can be extracted from archives with current time as last modification time by selecting one or more archive files in WinRAR, clicking in WinRAR toolbar on item Extract to, selecting the second tab Advanced and unchecking on this tab in first group File time the option Set modification time which is by default checked.
Then the last extracted files/directories in downloads folder are listed at top on viewing the downloads folder with list sorted according to last modification time with newest at top and oldest at bottom.
It is possible to configure in WinRAR a specific folder as extraction folder to avoid that newly downloaded archive files are extracted into the downloads folder itself with restored last modification time making them more difficult to find in the list of files and directories in downloads folder which should be cleared from time to time in any case. So it is possible to create in the downloads folder or the desktop folder a subfolder like Newly Extracted
and configure this directory as default extraction folder in WinRAR.
After creation of the folder Newly Extracted
, click in WinRAR in last but one main menu Options on first menu item Settings, select the third tab Paths, click on button Browse of Default folder for extracted files and browse to just created folder Newly Extracted
. It is recommended to check also Append archive name to path and Remove redundant folders from extraction path. Click on button Help for a description of these settings.
It is of course necessary to move the files and directories extracted into the folder Newly Extracted
to a more suitable directory after evaluation or processing them after the extraction or delete the subfolders no longer needed after extraction and usage before extracting the next archive files into the folder Newly Extracted
.