在 CentOS(以及大多数 Linux 系统)中,时间戳(timestamp)的默认单位是秒。
int 或 time_t)date +%s
输出类似:1719300000
表示 1970-01-01 00:00:00 UTC 之后过了 1719300000 秒秒级时间戳(默认)
date +%s
毫秒级时间戳
date +%s%3N
微秒级时间戳
date +%s%6N
纳秒级时间戳
date +%s%9N
文件时间戳
stat 文件名 中的 Access / Modify / Change time日志 / 系统时间
rsyslog、journalctl 等默认使用秒级时间戳struct timeval(秒 + 微秒)或 struct timespec(秒 + 纳秒)✅ CentOS 的时间戳默认单位是:秒(second)
✅ 毫秒、微秒、纳秒是扩展表示,不是默认单位
如果你是在 数据库、程序、脚本或日志 中看到时间戳,不确定单位,可以把具体场景发给我,我可以帮你判断。