Go Linux synchronizes time in a virtual machine
http://www.enkj.com/help/newscontent/55643
The time synchronization can be achieved by experiment.
The time display problem was found after rebooting the system:
[[Email protected] ~]# Date
Sat Mar 7 08:58:27 PST 2009
In fact, it is Beijing time March 8, 2009 00:58, a difference of 16 hours.
Online Search PST time, the original PST time for the United States Pacific Standard Time, this time zone is located in Greenwich West 8 time zone, late Beijing time 16 hours. (This is the vmware6.5 automatic installation of RHEL5 system to blame)
Discover/etc/sysconfig/clock files are configured in United States time:
[Email protected] ~]# Cat/etc/sysconfig/clock
Zone= "America/los_angeles"
Utc=true
Arc=false
UTC is true to indicate that the RTC is saved in UTC time, and False indicates that the local time is saved.
It is then modified to:
[Email protected] ~]# Cat/etc/sysconfig/clock
Zone= "Asia/shanghai"
Utc=false
Arc=false
The problem continues after rebooting the system! So I thought of the locale
[Email protected] ~]# locale
Lang=en_us. UTF-8
Lc_ctype= "en_US. UTF-8 "
Lc_numeric= "en_US. UTF-8 "
Lc_time= "en_US. UTF-8 "
Lc_collate= "en_US. UTF-8 "
Lc_monetary= "en_US. UTF-8 "
Lc_messages= "en_US. UTF-8 "
Lc_paper= "en_US. UTF-8 "
Lc_name= "en_US. UTF-8 "
Lc_address= "en_US. UTF-8 "
Lc_telephone= "en_US. UTF-8 "
Lc_measurement= "en_US. UTF-8 "
Lc_identification= "en_US. UTF-8 "
Lc_all=
[Email protected] ~]# cat/etc/sysconfig/i18n
Lang= "en_US. UTF-8 "
Sysfont= "Latarcyrheb-sun16"
Modified to:
[Email protected] ~]# cat/etc/sysconfig/i18n
Lang= "ZH_CN. UTF-8 "/* English environment can be changed to Zh_us. UTF-8 * *
Sysfont= "Latarcyrheb-sun16"
Save exit Log on again to execute date
[[Email protected] ~]# Date
March 07, 2009 Saturday 09:13:44 PST
If the above is not set, try the following command
Or show PST time,
# Rm/etc/localtime
# Ln-sf/usr/share/zoneinfo/asia/shanghai/etc/localtime
Virtual Machine Linux and host time synchronization