一、查看和修改Linux的时区1. 查看当前时区命令 : “date -R”2. 修改设置Linux服务器时区方法 A命令 : “tzselect”方法 B 仅限于RedHat Linux 和 CentOS命令 : “timeconfig”方法 C 适用于Debian命令 : “dpkg-reconfigure tzdata”3. 复制相应的时区文件,替换系统时区文件;或者创建链接文件cp /usr/share/zoneinfo/$主时区/$次时区 /etc/localtime例如:在设置中国时区使用亚洲/上海(+8)cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime二、查看和修改Linux的时间1. 查看时间和日期命令 : “date”2.设置时间和日期例如:将系统日期设定成2009年11月3日的命令命令 : “date -s 11/03/2009″将系统时间设定成下午5点55分55秒的命令命令 : “date -s 17:55:55″3. 将当前时间和日期写入BIOS,避免重启后失效命令 : “hwclock -w”注:date不加参数可以直接看到当前日期时间cal不加参数可以直接看到本月月历安装centos/rhel时候,应当取消”系统时钟使用utc时间”这个选项,如何忘了取消,系统时钟会差8小时。#vi /etc/sysconfig/clock把utc=true 修改为 utc=false,保存后重启即可。1、将linux的时区设置为上海#ln -sf /usr/share/zoneinfo/asia/shanghai /etc/localtime或者#cp /usr/share/zoneinfo/asia/shanghai /etc/localtime2、#tzsetup是 timezone 设置工具 , 5.asia -> shanghai3、用date命令来查看和设置系统时间date 07271254201712:54 2017-07-274、/usr/sbin/ntpdate server;/sbin/hwclock -w;5、强制把系统时间写入cmos#clock -w6、系统时钟 date -r7、硬件时钟hwclock -r8、查看硬件时钟的操作:# hwclock –show 或# clock –show9、redhat-config-date or dateconfig – these commands start the red hat date/time/time zone configuration gui.10、zdump – this utility prints the current time and date in the specified time zone. example:# zdump japan