System Time Setting

From Manjaro Linux
Jump to: navigation, search

Setting Your System's Time

Occasionally some users have the need to reset their Manjaro system's time/date. Beginners can achieve this by using the Manjaro Settings Manager and clicking on "Time and Date".

For intermediate and advanced users, an easy process involving a few steps at the command line is described in this paragraph.

Check your system's time/date settings

The following command:

[handy@jarmano ~]$ timedatectl status

Gives this output on my machine:

[handy@jarmano ~]$ timedatectl status
      Local time: Mon 2013-07-08 10:21:32 WST
  Universal time: Mon 2013-07-08 00:21:32 UTC
        RTC time: Mon 2013-07-08 00:21:32
        Timezone: Australia/Perth (WST, +800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2013-04-07 02:59:59 WST
                  Sun 2013-04-07 02:00:00 WST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2013-10-06 01:59:59 WST
                  Sun 2013-10-06 03:00:00 WST

The above output has the wrong Timezone, & NTP not enabled. If the output on your machine does NOT have the correct Timezone: &/or has NTP enabled: no then continue & we'll fix those problems up.

Turn on the Network Time Protocol (NTP) [1]

First off we had better be sure that even though the ntp package is installed by default on the Manjaro system, it is actually there, if it is already there this will do no harm:

 [handy@jarmano ~]$ sudo pacman -S ntp

Now we can turn on ntp on by using the following command in the Terminal (sudo requires the root password):

 [handy@jarmano ~]$ sudo timedatectl set-ntp true

List Supported Timezones (locales)

The following command lists the supported timezones:

[handy@jarmano ~]$ timedatectl list-timezones

Scroll through this list (use the space bar to move to the next page) to find yours, then use your mouse to highlight it & then copy it using the Terminal's menu or the keyboard shortcuts (Ctrl, Shift & C). Typing q at any time will return you to the Terminal prompt.

Set the Correct Timezone

Now that you have your timezone copied to the clipboard, we need to tell the system to use it. We do that with the following command (requires root password), this example uses my timezone of Australia/Sydney:

[handy@jarmano ~]$ sudo timedatectl set-timezone Australia/Sydney

Verify that your Timezone (time & date) & NTP are working

To verify that your input has worked enter the following command:

[handy@jarmano ~]$ timedatectl status
      Local time: Mon 2013-07-08 10:21:32 EST
  Universal time: Mon 2013-07-08 00:21:32 UTC
        RTC time: Mon 2013-07-08 00:21:32
        Timezone: Australia/Sydney (EST, +1000)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2013-04-07 02:59:59 EST
                  Sun 2013-04-07 02:00:00 EST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2013-10-06 01:59:59 EST
                  Sun 2013-10-06 03:00:00 EST

You should now see the Timezone: <Country/City> with your previously entered Country/City, NTP enabled: yes should be showing & most importantly your time & date should be correct.

Set the System Time

For those that have a need to set the system's clock directly, use the following command:

[handy@jarmano ~]$ sudo timedatectl set-time "2013-08-11 23:56:16"

Support

For Support please post in this Manjaro forum thread: [2]


Using the Timeset Script

The Timeset Script can be used to configure most of the system time/date settings from a single place.

Timeset-cli.png

Its usage is mostly self explainatory.

How to get it

It is present in the Manjaro repository.

To install it:

sudo pacman -S timeset

To run the script:

sudo timeset

Using Timeset-Gui (Graphical version of timeset)

Timeset-gui.png


Timeset-gui is also present in the repositories and can be installed with:

sudo pacman -S timeset-gui

To run it, either use the Time Settings icon in the menu under the System category, or to launch it from a terminal,

sudo timeset-gui

Support

For more information on timeset / timeset-gui, see the following forum thread: [3]


Dual Booting with Windows

If on dual booting with Windows or any other OS, you find that the time is messed up, it could be because they use different time values for the hardware clock.

Manjaro (& Arch) take the hardware clock to be in UTC, while Windows and some other Linux distributions assume the hardware clock to be in Local time. To correct this, one could set Windows to use hardware clock time as UTC.

There exists a Manjaro Wiki page with a very effective & far more reliable method than that of editing the Windows registry. The Manjaro Wiki page can be found here: [4]

The following article has some information on this subject: [5]