Ubuntu – Hardware Clock interpreted as UTC

16.04time

I have just installed Ubuntu 16.04.1 replacing Windows 8.1. But the system time +5:30 ahead of actual time. I am from India and the UTC offset is +5:30. By running hwclock i found that my system interprets the hardware clock as UTC, while it actually is the local time. I tried to edit the /etc/default/rcS file (as per Hardware clock is using UTC time). But rcS file doesn't contain the UTC entry. The file contents are shown below. What can be done?

Result of hwclock –debug:

hwclock from util-linux 2.27.1
Using the /dev interface to the clock.
Last drift adjustment done at 1474290330 seconds after 1969
Last calibration done at 1474290330 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2016/09/19 18:55:12
Hw clock time : 2016/09/19 18:55:12 = 1474291512 seconds since 1969
Time since last adjustment is 1182 seconds
Calculated Hardware Clock drift is 0.000000 seconds
Monday 19 September 2016 06:55:11 PM IST  .186866 seconds

rcS file:

#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.

# delete files in /tmp during boot older than x days.
# '0' means always, -1 or 'infinite' disables the feature
#TMPTIME=0

# spawn sulogin during boot, continue normal boot if not used in 30 seconds
#SULOGIN=no

# do not allow users to log in until the boot has completed
#DELAYLOGIN=no

# be more verbose during the boot process
#VERBOSE=no

# automatically repair filesystems with inconsistencies during boot
#FSCKFIX=no

Best Answer

If file /etc/adjtime is not present, systemd assumes the hardware clock is set to UTC.

The hardware clock can be queried and set with the timedatectl command. To change the hardware clock time standard to localtime, use:

sudo timedatectl set-local-rtc 1

If you want to revert to the hardware clock being in UTC, do:

sudo timedatectl set-local-rtc 0

These will generate /etc/adjtime automatically and update the RTC accordingly; no further configuration is required.