clock.xml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-scripts-clock">
  8. <?dbhtml filename="clock.html"?>
  9. <title>Configuring the system clock</title>
  10. <indexterm zone="ch-scripts-clock">
  11. <primary sortas="d-clock">clock</primary>
  12. <secondary>configuring</secondary></indexterm>
  13. <para>This section discusses how to configure the
  14. <command>systemd-timedated</command> system service, which configures
  15. system clock and timezone.</para>
  16. <para>Systemd provides a <command>timedatectl</command> utility which is
  17. used to communicate with <command>systemd-timedated</command>. It can be used
  18. to set the system clock in local time or UTC time, depending on the hardware
  19. clock setting. By default, <command>systemd-timedated</command> will assume
  20. that clock is set to UTC time.</para>
  21. <para>If you cannot remember whether or not the hardware clock is set to UTC,
  22. find out by running the <userinput>hwclock --localtime --show</userinput>
  23. command. This will display what the current time is according to the hardware
  24. clock. If this time matches whatever your watch says, then the hardware clock is
  25. set to local time. If the output from <command>hwclock</command> is not local
  26. time, chances are it is set to UTC time. Verify this by adding or subtracting
  27. the proper amount of hours for the timezone to the time shown by
  28. <command>hwclock</command>. For example, if you are currently in the MST
  29. timezone, which is also known as GMT -0700, add seven hours to the local
  30. time.</para>
  31. <para>If your clock is set to local time, tell <command>systemd-timedated</command>
  32. about it by running the following command:</para>
  33. <screen role="nodump"><userinput>timedatectl set-local-rtc 1</userinput></screen>
  34. <para><command>timedatectl</command> can also be used to change system time and
  35. time zone.</para>
  36. <para>To change your current system time, issue:</para>
  37. <screen role="nodump"><userinput>timedatectl set-time YYYY:MM:DD HH:MM:SS</userinput></screen>
  38. <para>Hardware clock will also be updated accordingly.</para>
  39. <para>To change your current time zone, issue:</para>
  40. <screen role="nodump"><userinput>timedatectl set-timezone TIMEZONE</userinput></screen>
  41. <para>You can get list of available time zones by running:</para>
  42. <screen role="nodump"><userinput>timedatectl list-timezones</userinput></screen>
  43. <note><para>Please note that <command>timedatectl</command> command can
  44. be used only on a system booted with Systemd.</para></note>
  45. </sect1>