https://help.ubuntu.com/community/UbuntuTime at "Using the Command Line (unattended)" seems to answer by question but doesn't seem to work in the latest Ubuntu (Xenial). The dpkg-reconfigure
command seems always to reset the timezone to UTC regardless of what is written to /etc/timezone
. How do I set the default timezone programmatically in Ubuntu Xenial?
Asked
Active
Viewed 3,175 times
1

DepressedDaniel
- 631
1 Answers
5
The command for setting the timezone in Ubuntu 16.04 is timedatectl
.
The following command will set your timezone to what you want:
timedatectl set-timezone Country/City
To turn UTC
off, run the following command:
timedatectl set-local-rtc 1
But this is NOT recommended because of the updates not happening to the RTC in time sync. I have actually found that in dual-booting with Windows, it is better to set Windows to use UTC, then the clock is always correct between reboots between Windows and Ubuntu. An answer for setting Windows to UTC can be found here: https://askubuntu.com/a/169384/231142
Running that command you will get the following warning:
Warning: The system is configured to read the RTC time in the local time zone.
This mode can not be fully supported. It will create various problems
with time zone changes and daylight saving time adjustments. The RTC
time is never updated, it relies on external facilities to maintain it.
If at all possible, use RTC in UTC by calling
'timedatectl set-local-rtc 0'.
To find your timezone that you set to, run the following:
timedatectl list-timezones
and choose the closest city to you.
Hope this helps!
timedatectl set-local-rtc 1
. That controls whether Ubuntu sees the RTC clock as being in UTC (which is a concern only if you're dual-booting with Windows). Setting Ubuntu's timezone should be enough. – muru Oct 10 '16 at 02:31