Master:
# 1    How to Change the Timezone in Linux                  
exp
Online no
State
Grouping Member
Class class4
Score 298
Wealth 194
Posts 230
Login 10:43:01
This should be also answer how to setup time for linux redhat system.
1. Logged in as root, check which timezone your machine is currently using by executing `date`. You'll see something like Mon 17 Jan 2009 12:15:08 PM PST, PST in this case is the current timezone.
2. Change to the directory /usr/share/zoneinfo here you will find a list of time zone regions. Choose the most appropriate region, if you live in Australia directory.
3. If you wish, backup the previous timezone configuration by copying it to a different location. Such as

cp /etc/localtime /etc/localtime-old

4. Create a symbolic link from the appropiate timezone to /etc/localtime. Example:

ln -sf /usr/share/zoneinfo/Australia/Sydney /etc/localtime

5. If you have the utility rdate, update the current system time by executing

/usr/bin/rdate -s time-a.nist.gov

6. Set the ZONE entry in the file /etc/sysconfig/clock file (e.g. "America/Los_Angeles")
7. Set the hardware clock by executing:

/sbin/hwclock --systohc
Hits: 217, Date: 2009-10-08 00:12:14
[Agree] ( 10 ) [Against] ( 13 )

# 2    you can install rdate by yum                  
exp
Online no
State
Grouping Member
Class class4
Score 298
Wealth 194
Posts 230
Login 10:43:01
yum install rdate
Hits: 216, Date: 2009-10-08 00:13:13
[Agree] ( 13 ) [Against] ( 15 )

# 3    php may still displays wrong date                  
exp
Online no
State
Grouping Member
Class class4
Score 298
Wealth 194
Posts 230
Login 10:43:01
So we can change somethings in php.ini

[Date]
; Defines the default timezone used by the date functions
; date.timezone =

uncommence the last line to
date.timezhone = Australia/Sydney

then it works
Hits: 213, Date: 2009-10-08 05:00:38
[Agree] ( 10 ) [Against] ( 13 )

1 - 3 [ 3]

Reply: How to Change the Timezone in Linux

*First line:


More content:


Tags:



Hint: You cannot post here before loginLogin | Register

nothing