Ubuntu core 16 how to change the timezone?/etc/localtime file is read only

Modifying /etc/localtime file is not allowed. In addition to a command (timedatectl set-timezone ZONE), there are any other commands to modify the time zone?. i think that using command(timedatectl set-timezone ZONE) is
Very inconvenient to change the time zone.

thanks

What is the problem with using timedatectl for this?

In any case, /etc/localtime is only a symlink to a symlink in /writable that points to the right zoneinfo, so you can update that manually if you wish.

if i want to change to timezone UTC12(Time zone
West 12 District) , i need to check the timezone area lists, and the lists area don’t have timezone UTC12 (Time zone
West 12 District) , i have check the symlink in /writable and so…, the final file is read only too.

if i want to change to timezone UTC12(Time zone
West 12 District) , i need to check the timezone area lists, and the lists area don’t have timezone UTC12 (Time zone
West 12 District) , i have check the symlink in /writable and in Final document, the final document is also read only.

sudo timedatectl set-timezone Etc/GMT+12?

the structure is actually as following:

$ ls -l /etc/localtime 
lrwxrwxrwx 1 root root 23 Oct  1 12:44 /etc/localtime -> /etc/writable/localtime
$ ls -l /etc/writable/localtime 
lrwxrwxrwx 1 root root 33 Oct 10 15:43 /etc/writable/localtime -> /usr/share/zoneinfo/Europe/Berlin

and here is an example how to use it in a snap:

(the interface connection check in there could nowadays be avoided with using an interface-hook)

thanks for set timezone question solved. another question is how to set Daylight Saving Time?

you dont :wink: it sets itself … the timezone info is regulary updated (when you receive a core/core18 update) inside that info the DST time is set, once the system hits the DST date it automatically switches based on the timezone in use (this is not different to any other Ubuntu, nothing specific to core)

i only want know how to set Daylight Saving Time in ubuntu core system, other things i don’t care.

again, you don’t (like you dont do it manually on any other linux, this is not UbuntuCore specific or anything). The DST is hardcoded in the tzdata debian package that is included in the core snap. It ships all relevant info about a time zone, including the date when the system automatically adjusts the time itself. If you pick a time zone with timedatectl set-timezone ... the system has all relevant info and will switch on its own …

You can check the given DST time for a time zone using the zdump command:

ogra@pi4:~$ zdump -c 2020 -v Europe/Berlin|grep 2019
Europe/Berlin  Sun Mar 31 00:59:59 2019 UT = Sun Mar 31 01:59:59 2019 CET isdst=0 gmtoff=3600
Europe/Berlin  Sun Mar 31 01:00:00 2019 UT = Sun Mar 31 03:00:00 2019 CEST isdst=1 gmtoff=7200
Europe/Berlin  Sun Oct 27 00:59:59 2019 UT = Sun Oct 27 02:59:59 2019 CEST isdst=1 gmtoff=7200
Europe/Berlin  Sun Oct 27 01:00:00 2019 UT = Sun Oct 27 02:00:00 2019 CET isdst=0 gmtoff=3600

(i.e. the above says that central Europe switches to winter time next week, at 2:59 local time the clock is adjusted to 2:00)