Switch -TS<m,c,a>[N] - save or restore file time (modification, creation, access)
Switch -tsm instructs WinRAR to save file modification time, -tsc - creation time and tsa - last access time.
For RAR 4.x archive format the optional parameter after the switch is the number between 0 and 4 controlling the file time precision. Value '1' enables 1 second precision, 2 - 0.0065536 sec, 3 - 0.0000256 and 4 or '+' enables the maximum NTFS time precision, which is equal to 0.0000001 sec. Value '0' or '-' means that creation and access time are not saved and low (two seconds) precision is used for modification time. Higher precision modes add more data to archive, up to 19 additional bytes per file in case of -tsm4 -tsa4 -tsc4 combination. If no precision is specified, WinRAR uses '4' (high) value.
RAR 5.0 archive format saves file times either with 1 second precision for parameter value '1' or with maximum NTFS precision for '2', '3' and '4'.
Default WinRAR mode is -tsm4 -tsc0 -tsa0, so modification time is stored with the high precision and other times are ignored.
It is necessary to specify -tsc and -tsa switches to set creation and access time when unpacking files (precision is irrelevant, but must not be 0). By default WinRAR sets only the modification time, even if archive contains creation and last access time. Setting the modification time to unpacked files may be also disabled with -tsm-.
It is possible to omit the time type letter if you need to apply the switch to all three times. For example, -tsm4 -tsa4 -tsc4 can be replaced by -ts4, -ts+ or -ts. Use -ts- to save only the low precision modification time or to ignore all three file times on unpacking.
When creating an archive, WinRAR automatically reduces the precision if high mode is not supported by the file system. It is not more than 2 seconds on FAT and 1 second in Unix. NTFS time precision is 0.0000001 second.
Operating systems limit which time can be set on unpacking. Windows allows to set all three times, Unix - modification and last access, but not creation.
All modes described above are supported only by RAR format. In ZIP archives the high precision modification time is stored in the same data structure as creation and last access times. When archiving to ZIP, all three times are controlled by -ts or -tsm option, while -tsa and -tsc are ignored. Use -ts or -tsm to save all times in high precision format (default ZIP mode), specify -ts- or -tsm- to store only the low precision modification time. When unpacking ZIP archive, -tsm -tsc -tsa switches can be used individually to control corresponding times just like as for RAR format.
Examples
- Store all file times with the highest possible precision:
WinRAR a -ts backup
- Restore modification and last access time. Switch -tsm is not required, because WinRAR uses it by default:
WinRAR x -tsa backup
- Store low precision modification and creation time. Without -tsm1 WinRAR would save the high precision modification time.
WinRAR a -tsm1 -tsc1 backup