Difference between revisions of "Linux datetime"

From Noah.org
Jump to navigationJump to search
m
Line 1: Line 1:
 
[[Category:Engineering]]
 
[[Category:Engineering]]
 +
== Set your clock and timezone ==
 
1. su to root
 
1. su to root
  

Revision as of 22:52, 31 May 2007

Set your clock and timezone

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