电脑
Linux系统(Redhat、Centos)
查看当前时间和时区。使用命令:datedate -RCST:中国标准时间(China Standard Time), UTC:协调世界时,又称世界标准时间,简称UTC,GMT:格林尼治标准时间(旧译格林威治平均时间或格林威治标准时间;英语:Greenwich Mean Time,GMT)是指位于英国伦敦郊区的皇家格林尼治天文台的标准时间,因为本初子午线被定义在通过那里的经线。CDT<美>中央时区,-0500表示西五区。我们国家,CST,东八区(+0800)
在/etc/profile里面设置 TZ='Asia/Shanghai'; export TZ并使其生效。修改时区成功,我们国家,CST,东八区(+0800)。echo TZ='Asia/Shanghai'; export TZ >> /etc/profilesource /etc/profile
修改时区方法2。复制相应的时区文件,替换系统时区文件;或者创建链接文件。时区文件在/usr/share/zoneinfo/,系统时区文件是/etc/localtime,使用命令:cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime或者rm -f /etc/localtimeln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
修改时间。使用命令:ntpdate ntpdate time.pool.aliyun.comntpdate ntp.nblug.org
将当前时间和日期写入BIOS,避免重启后失效。hwclock -w再介绍一些date常用参数date +%F' '%H:%M:%Sdate +%Fdate +%s 修改时间:月日小时分钟年date date -s 月/日/年date -s 11/11/2000date -s 17:55:55
一些网络上时间服务器:time.pool.aliyun.com time.edu.cn ntp.nblug.org