Simple-Tracker / qBittorrent-ClientBlocker

一款适用于 qBittorrent/Transmission (Beta)/BitComet (Beta, Partial) 的客户端屏蔽器, 默认屏蔽包括但不限于迅雷等客户端. A client blocker compatible with qBittorrent/Transmission (Beta)/BitComet (Beta, Partial) which is prohibited to include but not limited to clients such as Xunlei.
MIT License
934 stars 24 forks source link

日志时区问题 #30

Closed dbox233 closed 6 months ago

dbox233 commented 6 months ago
......
[2024-03-10 05:07:00][Task] 此次封禁客户端: 2 个, 当前封禁客户端: 106 个.
root@OpenWrt:~/qBittorrent-ClientBlocker# date
Sun Mar 10 13:07:30 CST 2024
root@OpenWrt:~/qBittorrent-ClientBlocker# date +%z
+0800
root@OpenWrt:~/qBittorrent-ClientBlocker# date -u
Sun Mar 10 05:08:10 UTC 2024
......
root@OpenWrt:~/qBittorrent-ClientBlocker# uname -a
Linux OpenWrt 5.4.143 #0 SMP PREEMPT Wed Oct 6 13:26:37 2021 aarch64 GNU/Linux
root@OpenWrt:~/qBittorrent-ClientBlocker# ./qBittorrent-ClientBlocker -v
[2024-03-10 05:40:45][ShowVersion] qBittorrent-ClientBlocker 2.9 (linux, arm64).

如上,系统时区是UTC+8,但日志却使用UTC+0

Simple-Tracker commented 6 months ago

感谢反馈!

这是 OpenWrt 的问题, 请参见 https://stackoverflow.com/questions/54035376/why-running-golangs-time-now-at-openwrt-always-get-utc-timehttps://www.ohyee.cc/post/note_go_read_openwrt_timezone.

快速解决方法:

root@OpenWrt:/tmp/upload# opkg update
root@OpenWrt:/tmp/upload# opkg install zoneinfo-asia
root@OpenWrt:/tmp/upload# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
root@OpenWrt:/tmp/upload# ./qBittorrent-ClientBlocker 
[2024-03-10 13:59:59][ShowVersion] qBittorrent-ClientBlocker 2.9 (linux, mipsle).
dbox233 commented 6 months ago

原来如此,感谢!