openwrt 显示当前时间及更改时区


1. 直接输入 date 就可以显示 时间, 也可以加-u,

root@OpenWrt:/# date -u
Thu Mar 17 11:36:33 UTC 2016
root@OpenWrt:/# date -R
Thu, 17 Mar 2016 11:36:49 +0000


2. 在openwrt中更改时区 在/etc/config/systm 

中更改 

option timezone Asia/Shanghai
option timezone CST- 8
option timezone Asia/Shanghai 时区设置为亚洲/上海
option timezone CST-8 正8区

3. 在编译时直接改

参考这个

http://blog.163.com/l1_jun/blog/static/14386388201471112948506/

修改主机名,设定时区
修改package/base-files/files/etc/config/system

1
2
3
4
5
6
7
8
9
10
11
12
config system
option conloglevel  8
option cronloglevel  8
option hostname Openwrt
option timezone Asia/Shanghai
option timezone CST- 8
config timeserver ntp
list server  0 .openwrt.pool.ntp.org
list server  1 .openwrt.pool.ntp.org
list server  2 .openwrt.pool.ntp.org
list server  3 .openwrt.pool.ntp.org
option enable_server  0

option hostname Openwrt 设定主机名
option timezone Asia/Shanghai 时区设置为亚洲/上海
option timezone CST-8 正8区
list server 就是ntp服务器了。


你可能感兴趣的:(openwrt)