Modify linux/solaris time and time zone

1. Modify the time zone:
Linux:
1. Modify /etc/sysconfig/clock:
       ZONE=Asia/Tokyo
2. rm /etc/localtime   
3. ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime  
4. Restart the machine
Note : Before modifying, confirm whether /usr/share/zoneinfo/Asia/Tokyo /etc/localtime exists
. Set the time
date -s 2013-10-28
date –s 14:19:00

Solaris10:
change timezone:
vi /etc /TIMEZONE(links to /etc/default/init)
modify TZ=<timezone>, the timezone here should correspond to a file in /usr/share/lib/zoneinfo,
you must restart

eg:
TZ=Asia/Tokyo

two, the modification time is
linux :
Root uses the date command: date -s
1. Only modify the date, not the time, enter:
  date -s 2007-08-03 
2. Only modify the time, enter:
  date -s 14:15:00 
3. Modify the date and time at the same time, pay attention to add double quotation marks, there is a space between the date and time, enter:
  date -s "2007-08-03 14:15:00" 
4. After the modification After that, remember to enter:
  clock -w  
to write the system time into the CMOS
command to modify the time zone: tzselect

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326802503&siteId=291194637