Updating time in linux
The Network Time Protocol (NTP) is a protocol used to synchronize computer system clock automatically over a networks.The machine can have the system clock use Coordinated Universal Time (UTC) rather than local time.Use the ntpstat command to view the status of the NTP service on the instance.If you get an error message prompting that NTP is not installed then you have to install it on the server.Like the date three Tuesdays from now, five months from now, eight years ago: $ date -d "third tuesday" Tue Oct 30 PDT 2012 $ date -d "fifth month" Mon Mar 11 PDT 2013 $ date -d "8 years ago" Mon Oct 11 PDT 2004 $ date -d "23 years ago 2 months 19 days 17 hours 59 minutes" Sun Dec 31 PST 1989 because it’s easy to sort– year, month, day, single-digit months and days are padded to two digits, and it uses a 24-hour clock. On Linux it’s controlled by the TIME_STYLE environment variable, so you can override the default system-wide in The GNU manual spells all this out in plain English.You can experiment to your heart’s content, and then log out and log back in to reset to your system default. Note how you can use ordinary spacing and punctuation to control the appearance.You customize date and time displays to suit your own whims, and in consistent, script-friendly ways. And that is where we learn about the magic strings that let us ask for dates next week, last year, day of week, and many more.
My dream is a lifestyle that doesn’t need clocks at all, but I haven’t figured out how to do that in Linux.
The timedatectl command is a new utility for RHEL/Cent OS 7 and Fedora 21 based distributions, which comes as a part of systemd system and service manager, a replacement for old traditional date command used in sysvinit daemon based Linux distributions.
The timedatectl command allows you to query and change the configuration of the system clock and its settings, you can use this command to set or change the current date, time and timezone or enable automatic system clock synchronization with a remote NTP server.
On top of this, use of NTP is still recommended to deal with the fake clock "drifting" while the hardware is halted or rebooting.
With fake-hwclock installed your machine will not start up thinking it is 1970 all over again.
Search for updating time in linux:
fake-hwclock is a simple set of scripts to save the kernel's current clock periodically (including at shutdown) and restore it at boot so that the system clock keeps at least close to realtime.