Working With the Date Command Within a Terminal
When someone refers to the "Linux set date" operation, he's actually speaking of the Linux date command. It isn't difficult to use, you'll just want to be accurate since computing is based on keeping track of the time, especially in the case of operations such as running cron jobs. Keeping accurate time is also crucial in a network environment.
In the screen shot below you can see my use of the Linux set date command or simply, the Linux date command. First, I opened a terminal (as root) and typed "date" (commands are without the quote marks) which displayed the system date as you can see. I then typed "hwclock --show" to view what my computer's (hardware) clock was reporting for a date and time. Again, you can see that display as well. I then used the Linux date command to adjust the system's time by typing "date 041311252010." We have "04" for the month of April, "13" for the day, "1125" for the time, and "2010" for the year. I displayed the system time again using the date command. You can also see my second display of the hardware time which reports a different time from the system, same date, but different time.
I passed the "--systohc" option to the "hwclock" command to synchronize the two clocks and then did another display. Now, the system and hardware clocks both report the same date and time. Another option that you can pass to the "hwclock" command is the "hctosys" option to set the system time from your machine's hardware clock instead of the other way around. The "systohc" command can be remembered by saying "system to hardware clock" while the "hctosys" command can be remembered by saying "hardware clock to system." Knowing how to use the Linux set date and hwclock commands with its options in a terminal, also called a console on some systems, is part of Linux administration.