Difference between revisions of "Linux datetime"
From Noah.org
Jump to navigationJump to searchm |
m |
||
Line 10: | Line 10: | ||
4. Create a symbolic link from the appropiate timezone to /etc/localtime. | 4. Create a symbolic link from the appropiate timezone to /etc/localtime. | ||
ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime | ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime | ||
+ | or | ||
+ | ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime | ||
5. Use rdate or ntpdate to set the system time (ntpdate is better): | 5. Use rdate or ntpdate to set the system time (ntpdate is better): |
Revision as of 16:31, 29 March 2007
1. su to root
2. Find your timezone file under /usr/share/zoneinfo. For example:
/usr/share/zoneinfo/US/Pacific
3. OPTIONAL: backup the current timezone configuration:
cp /etc/localtime /etc/localtime.old
4. Create a symbolic link from the appropiate timezone to /etc/localtime.
ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime
or
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
5. Use rdate or ntpdate to set the system time (ntpdate is better):
/usr/bin/rdate time.nist.gov
or
/usr/sbin/ntpdate time.nist.gov
6. Set the hardware clock to the system time:
/sbin/hwclock --systohc