How to Make Unrar Show ISO 8601 Timestamps
By default, the standard unrar utility displays archive
contents using a compact tabular format with localized or truncated
two-digit year timestamps. To force unrar to output
timestamps in the standardized ISO 8601 format
(YYYY-MM-DD HH:MM:SS), you can utilize its built-in
technical listing mode or pipe the output through standard command-line
tools to reformat the data into a clean table.
Method 1: Use
the Technical List Command (lt or vt)
The default listing commands (unrar l and
unrar v) use a fixed-width table that abbreviates dates
(typically DD-MM-YY or MM-DD-YY). To view full
four-digit years and standard date-time representations natively within
unrar, append the t modifier:
unrar lt archive.raror for the verbose technical list:
unrar vt archive.rarIn technical mode, unrar outputs file entries in a
key-value block format rather than a compressed table. Each entry
contains a timestamp formatted according to ISO 8601 standards:
Name: document.pdf
Type: File
Size: 1048576
Packed size: 985200
Ratio: 93%
mtime: 2024-03-15 14:30:22
Attributes: -rw-r--r--
Method 2: Filter Technical Output for a Clean List
If you need a concise, tabular view containing only the ISO 8601
timestamp and the filename, parse the technical output using
awk:
unrar lt archive.rar | awk -F': ' '
$1 == "Name" { name = $2 }
$1 == "mtime" { print $2, "\t", name }
'This outputs:
2024-03-15 14:30:22 document.pdf
2024-03-16 09:12:05 image.png
Method 3: Use 7-Zip as an Alternative RAR Reader
Because the RARLAB unrar binary lacks a dedicated
command-line flag to alter the column formatting of the standard
unrar l table, an alternative approach is using
7z (p7zip). 7-Zip natively lists RAR archive contents using
ISO 8601 dates by default:
7z l archive.rarThis produces a standard tabular layout with full timestamps:
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2024-03-15 14:30:22 ....A 1048576 985200 document.pdf
------------------- ----- ------------ ------------ ------------------------