你问的应该是 “nohup 日志里的时间不对 / 时间错乱” 这类问题。常见原因和解释如下:
nohup 不会给日志加时间戳print(time.strftime(...))asctime✅ 排查:
date
再看程序里时间怎么取的
常见于:
date
# 如果显示 UTC 但你期望 CST
解决:
timedatectl set-timezone Asia/Shanghai
Docker 容器:
docker exec -it xxx date
timedatectl status
不同步会导致:
修复:
ntpdate pool.ntp.org
# 或
systemctl restart chronyd
nohup.out✅ 建议:
>> app.log 2>&1ls -l nohup.out
这是 文件时间,不是日志时间
你可以贴一点:
date 输出我可以帮你精确判断是 时区 / NTP / 程序代码 / 日志配置 哪一类问题。