Set the hardware clock on your computer from Linux

(0 votes, average 0 out of 5)

Rather than rebooting to set the hardware clock in the BIOS, you can sync the hardware clock on your machine to the current time in Linux using the hwclock and date commands.

To set the hardware clock's date and time, use the hwclock command:

hwclock --set --date "01/01/70 01:01:01"

 

The date command allows you to get the current date, in the above format when using these arguments:

date +'%m/%d/%y %H:%M:%S'

 

Thus, you can combine the two commands to sync the hardware clock with the time in your OS. Note the backtick character below (inside the double quotations) which executes the date command and dumps the output into the double quotations:

hwclock --set --date "`date +'%m/%d/%y %H:%M:%S'`"

 

Partner Links:
 
Related Articles

» How to Enable Playback of MKV Files in Windows 7 Media Center

Back up your registry and create a system restore point. This is in case any problems arise in the process. the Windows 7 version of the codec pack. (The actual download is hosted by Major Geeks). When the download completes, install the codec pack.If you are running the 64-bit version of Windows 7, download and install those components as well. the MKV Registry Hack for your version of Windows 7 (32 or 64 bit).Double click the downloaded .reg file and allow the process to complete. This will...

» How to Unpack a Tarball (.tgz, tar.gz, or tar.bz2)

Unpacking a tarball through the command line is a simple a matter of memorization.  Here is the command to unpack a .tgz or .tar.gz file:tar -xzf To unpack tar.bz2 files, simply change the z to a j:tar -xjf Upon running one of these commands you should see an extracted version of the directory without the .tar.gz or .tgz extension.

» How to Use a Linux (or Mac OS X) Terminal

Every computer hobbyist, at some point, learns to use Linux.  The transition from using a UI based interface in Windows or Mac to performing many functions through the terminal can be a jarring experience for many people.  Many users find the terminal difficult to use and inferior to navigating a UI.  However, the Linux terminal is an extremely powerful device that many learn to love and use often.  Here is a basic introduction to get your feet wet with a terminal.  It...