RedHat Linux操作系统修改时区的方法

swency 2010-03-24

Hereisanexampleofchangingthetimezone:(Loggedinasroot)

Inordertomanuallychangethetimezone,youcaneditthe/etc/sysconfig/clockfileandthenmakeanewsoftlinkto/etc/localtime.Hereisanexampleofchangingthetimezonemanuallyto“America/Denver”:

1.Selecttheappropriatetimezonefromthe/usr/share/zoneinfodirectory.Timezonenamesarerelativetothatdirectory.Inthiscase,wewillselect“America/Denver”

2.Editthe/etc/sysconfig/clocktextfilesothatitlookslikethis:

ZONE=”America/Denver”

UTC=true

ARC=false

Ofcourse,thisassumesthatyourhardwareclockisrunningUTCtime…

3.Deletethefollowingfile:/etc/localtime(backupitwhenyouneedit!)

4.Createanewsoftlinkfor/etc/localtime.Hereisanexampleofstep3andstep4:

#cd/etc

#ls-allocaltime

lrwxrwxrwx1rootroot39Mar2807:00localtime->/usr/share/zoneinfo/America/Los_Angeles

#rm/etc/localtime

#ln-s/usr/share/zoneinfo/America/Denver/etc/localtime

#ls-allocaltime

lrwxrwxrwx1rootroot34Mar2808:59localtime->/usr/share/zoneinfo/America/Denver

#date

FriMar2809:00:04MST2003

相关推荐

86981538 / 0评论 2014-07-24