Difference between revisions of "HOWTO: Set Clock"

From Sabayon Wiki
Jump to: navigation, search
m (adjust for systemd presence)
m (update: broken link to systemd howto, OpenRC no longer supported)
 
Line 3: Line 3:
  
 
==With systemd==
 
==With systemd==
Look at: [[HOWTO: systemd#timedatectl]]
+
Look at: [[HOWTO: systemd#timedatectl_-_-_Control_the_system_time_and_date.]]
  
 
==With OpenRC==
 
==With OpenRC==
{{Note| Please note that OpenRC will be dropped in summer 2014.}}
+
{{Warning| Please note that '''OpenRC is no longer supported''' in Sabayon.}}
 
===Adding NTP to your system===
 
===Adding NTP to your system===
  

Latest revision as of 13:18, 9 March 2014

Setting your Clock

For the whole of this how-to you need to be root user. So you might as well `su` now

With systemd

Look at: HOWTO: systemd#timedatectl_-_-_Control_the_system_time_and_date.

With OpenRC

Stop.png
Please note that OpenRC is no longer supported in Sabayon.

Adding NTP to your system

First off we are going to set up so that your computer will go out and find out what time it is on its own.

# equo install net-misc/ntp 

The next two commands will update the time on your system and adjust the time for your hardware clock

# ntpdate time-a.nist.gov
# hwclock --systohc 

Finally we are going to tell your computer that it needs to check the time when it boots up, and keep checking occasionally as long as it is booted up. Also we will set it up so that it will act as a time server for any other devices you might have on your network.

 # rc-update add ntpd default
# rc-update add ntp-client default 

Setting System Time

In our last step we set our hardware clock, now we are going to define our hardware clock. In you favorite text editor, as root, you need to edit:

 /etc/conf.d/hwclock 

You should see a line at the bottom of the top section that looks like

clock="UTC"

If it says anything other than UTC edit it and make it just as that line is in the example. Save and exit.

Setting Local Time

Finally we are going to tell the computer what time zone you are in.

First things first, we remove the link that already exists

 # rm /etc/localtime 

Now we are going to set a link to your actual timezone. The easiest way to drill down to this is using TAB complete, where you type a few letters and hit the tab key to complete the next little bit. If there are too many options it will show you your available options and then you keep typing. A pretty nifty trick.

 # ln -s /usr/share/zoneinfo/USE_TAB_COMPLETE_HERE_TO_SELECT /etc/localtime

an example would be

 ln -s /usr/share/zoneinfo/America/Adak /etc/localtime 

All done and thanks for playing ~Az