在 Debian 里“修改时间戳”通常有两种含义,下面分别说明:
sudo date -s "2026-01-15 10:30:00"
或只改时间:
sudo date -s "10:30:00"
sudo hwclock --systohc
表示从系统时间同步到硬件时钟(RTC)。
查看硬件时间:
sudo hwclock --show
Debian 通常使用 systemd-timesyncd 或 chrony / ntp
sudo timedatectl set-ntp true
查看状态:
timedatectl status
sudo apt install ntp
sudo systemctl enable ntp
sudo systemctl start ntp
如果你是问“文件的时间戳”:
touch -t 202601151030.00 filename
或使用参考文件:
touch -r reference_file filename
touch -a filename
touch -m filename
sudo timedatectl set-timezone Asia/Shanghai
查看时区:
timedatectl
如果你能具体说明是:
我可以给你更精确的命令。