Summary
`touch -t TIMESTAMP FILE` exits successfully but does not actually modify the file's mtime. The file retains its original (current) timestamp.
Reproduction
echo "test" > /tmp/test.txt
touch -t 202604061200.00 /tmp/test.txt
date -r /tmp/test.txt +"%Y%m%d%H%M.%S"
# Expected: 202604061200.00
# Actual: current timestamp (e.g. 202604090246.10)
Context
Bashblog uses `touch -t` to preserve original post timestamps after rebuilding:
touch_timestamp=$(LC_ALL=C date -r "${1%%.*}.html" +"$date_format_timestamp")
# ... rebuild the file ...
touch -t "$touch_timestamp" "$filename"
Without working `touch -t`, post timestamps reset to the rebuild time, breaking chronological ordering of posts.
Expected behavior
`touch -t CCYYMMDDhhmm.ss FILE` should set the file's modification time to the specified timestamp.
Summary
`touch -t TIMESTAMP FILE` exits successfully but does not actually modify the file's mtime. The file retains its original (current) timestamp.
Reproduction
Context
Bashblog uses `touch -t` to preserve original post timestamps after rebuilding:
Without working `touch -t`, post timestamps reset to the rebuild time, breaking chronological ordering of posts.
Expected behavior
`touch -t CCYYMMDDhhmm.ss FILE` should set the file's modification time to the specified timestamp.