[Tutorial] Change timezone on centos linux vps

Thứ Hai, 26 tháng 5, 2014
After installing CentOS, we sometimes realize that in the time machine is not right with the current time zone, which is the default time zone PST. 


The timezone adjustment in Linux is fairly simple, following the guidelines change timezone in CentOS. 

Method 1: Use the ssh command: 

First, you must know your country's time zone, the time zone list are listed in the directory / usr / share / zoneinfo / 
Simple operation to change the time zone to create the path to the file / etc / localtime. In statements after the change of time zone to Vietnam time zone
# Ln-sf / usr / share / zoneinfo / Asia / Ho_Chi_Minh / etc / localtime 
OR you can copy the settings and replace the current local time in order
# Cp / usr / share / zoneinfo / Asia / Ho_Chi_Minh / etc / localtime 
To check that the time zone has not changed you can do:
# Date



Method 2: Use the php.ini file (/ etc / php.ini) 

- Open the php.ini file, find: 
Code:
  date.timezone = 
- Replace with: 
Code:
  date.timezone = Asia / Ho_Chi_Minh 
- Restart apache: 
Code:
  service httpd restart 

Chia sẻ bài viết ^^
Other post

All comments [ 0 ]


Your comments