Switch -TS[m,c,a,p][+,-,1] - save or restore file time (modification, creation, access, preserve)


Use -tsm to save the file modification time, -tsc for creation time and -tsa for last access time. Multiple -ts switches, such as -tsc -tsa, are allowed. If 'm', 'c' or 'a' are not specified, all three file times are assumed.

Append '+' to store a file time with maximum possible precision. The exact value depends on the particular operating system also as the file system and can be up to 100 nanoseconds in Windows and 1 nanosecond in Unix systems. Append '1' to set 1 second precision or '-' to not save a file time, such as -ts- to omit all 3 times. If '+', '-' or '1' are not present, '+' is assumed, so -ts+ and -ts both save all three high precision times.

All stored times for same file always have the same precision. If different precisions are specified, such as -tsm1 -tsc+, common one is selected.

If -ts switch is not specified, WinRAR stores the high precision modification time and omits two other times.

By default WinRAR sets only the modification time for extracted files, even if archive contains other times. Use -ts or -ts+ when unpacking to set all three times, -tsc and -tsa to set creation and last access times, -tsm- or -ts- to set the current system time instead of modification time stored in archive.

Use -tsp switch to preserve the original last access file time of source files when archiving. This switch attempts to keep the original last access time of archiving files, but it does not control which timestamps are to be stored in archive. It has to be combined with other -ts switches for this purpose. For example, if we wish to save the last access time to archive and preserve the last access time of source files, we need to use -tsa -tsp together. To open some files with -tsp switch, it may be necessary to run WinRAR as administrator.

It is allowed to combine several modifiers in the same switch, such as -tscap instead of -tsc -tsa -tsp.

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

  1. Store all file times with the highest possible precision:

WinRAR a -ts backup

  1. Restore modification and last access time. Switch -tsm is not required, because RAR sets the modification time by default. If we wish to restore only the last access time, we should use -tsm- -tsa switches:

WinRAR x -tsa backup

  1. Store low precision modification and creation time. Preserve the last access time of source files.

WinRAR a -tsm1 -tsc1 -tsp backup